* Problems starting /init
From: David H. Lynch Jr. @ 2006-01-04 23:03 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <20051208231947.92EB9353F77@atlas.denx.de>
I have a kernel for a new board (Linux 2.6.14.5, Pico E12/Xilinx V4
PPC405) booting to the point of starting /init.
/init appears to be getting loaded correctly - the execve call seems
happy. But I get no output on the console.
I have tried:
executing
sys_write(1,"Test",4);
inside init/main.c immediately before starting /init - works fine.
starting a "hello World" application written in PPC asm as /init -
works fine. The kernel panics on exit but that is normal, /init is not
supposed to exit.
starting a c "Hello World" application that uses glibc, fputs, printf,
fwrite, to display a string - again works fine.
But I can not get busybox to output a thing either run as /init or run
as /bin/sh.
I have aslo tried /bin/sash - no output.
I have even cross compiled sash - with all kinds of "I am here"
debugging scattered through main(), If I runn it on a powerbook, I get
what I expect. If I run it as /bin/sh on the e12 I get no output.
Does anyone even have any ideas what I can look at ?
^ permalink raw reply
* powerpc vs ppc build
From: Jeff Angielski @ 2006-01-04 22:44 UTC (permalink / raw)
To: linuxppc-embedded
Is there a summary of the differences between the ppc and powerpc builds
for the 2.6 kernels? Or something describing what the community, in
general, is trying to fix/address with the different schemes - besides
the merging of ppc and ppc64?
Or how about the current status of both build architectures? It seems
that people are fixing one build and breaking the other... :(
Jeff Angielski
The PTR Group
^ permalink raw reply
* Re: Segmentation fault with X.org and Coral-P drivers
From: Wolfgang Denk @ 2006-01-04 21:11 UTC (permalink / raw)
To: Matthias Transier; +Cc: linuxppc-embedded
In-Reply-To: <b789c2e60601040959n4f6e730dw@mail.gmail.com>
Dear Matthias,
in message <b789c2e60601040959n4f6e730dw@mail.gmail.com> you wrote:
>
> it finally works :-). I had to make a small modification to the x.org
> source code. The file xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c
Congrats! To make it perfect: could you please wrap up your
modifications into a patch we can put on our FTP server, so others
can benefit from this, too?
Thanks in advance.
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
Even historians fail to learn from history -- they repeat the same
mistakes.
-- John Gill, "Patterns of Force", stardate 2534.7
^ permalink raw reply
* Re: Segmentation fault with X.org and Coral-P drivers
From: Wolfgang Denk @ 2006-01-04 21:10 UTC (permalink / raw)
To: Matthias Transier; +Cc: linuxppc-embedded
In-Reply-To: <b789c2e60601040819j65eea749p@mail.gmail.com>
Dear Matthias,
in message <b789c2e60601040819j65eea749p@mail.gmail.com> you wrote:
>
> > and EP5200 and Lite5200 are two different boards.
>
> Ok, my fault. I saw a Lite5200 on a picture somewhere and it looked
> pretty much like my EP board :-). But what I can tell for sure is:
> when I remove the "Embedded Planet" sticker on the board, there is a
> Freescale logo and a print (directly on the board): "IceCube Version
> 103"
Ouch. So far for marketing methods. I didn't know this.
> > Our kernel does not include any support for the EP5200 board.
>
> I checked it out from CVS, configured it, and it works (besides the X11 thing).
It should work on the Lite5200 board. I just expected different
hardware ...
> I did not use the prebuilt binaries, but I was able to compile the
I see.
> driver within my x.org tree. (I had to adapt the Imakefiles by myself,
> the provided ones were too different from the originals.)
If you want to send me your patches: they are welcome.
> The last line is a message that I added. Since the output stops at
> that point, it must be the next call that fails
> (mb86290_driver.c:604):
>
> if (!xf86I2CProbeAddress(fPtr->I2C, I2C_SAA7113))
> return FALSE;
>
> May that be a problem with the i2c driver in the kernel which does not
> exactly fit with my board?
This is not the kernel's (MPC5200) I2C driver; actually I2C is only
needed for external video decoder chip that _may_ be connected to the
CoralP chip. It is the CoralP itself that acts as an I2C "adapter" in
this case. By writing to some CoralP registers, accessible from the
host (CPU) via PCI, the driver manipulates external pins of the
CoralP chip, which form the I2C bus. It is an external (relative to
both CoralP and the CPU) device that is controlled through I2C; in
your case the Philips SA71111 video decoder chip.
> The following message also appears in Xorg.0.log, some lines above:
> (II) MB86290(0): I2C bus "MB86290 I2C bus" removed.
>
> Thanks in advance for any hint that you can give me.
You can disable video capture support, and thus the I2C, by setting
option "Video" to "no" in the driver's X11 config file:
Section "Device"
Identifier "MB86290 card"
Driver "mb86290"
Option "Video" "no"
EndSection
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
Artificial Intelligence is the study of how to make real computers
act like the ones in movies.
^ permalink raw reply
* restore_user_regs and fpu
From: Heikki Lindholm @ 2006-01-04 18:36 UTC (permalink / raw)
To: linuxppc-dev
Hello,
I haven't really confirmed this can happen, but I was wondering whether
the following would be possible. Looking at restore_user_regs in
ppc/kernel/signal_32.c and assuming:
* last_task_used_math == current, eg. a signal handler used fpu
* fpu state is still what the sig handler left there
If after the fpu state is restored to current->thread.fpr (copy_user)
somebody preempts this task and uses fpu, wouldn't it cause the fpu
state (of the sig handler) to be saved to
last_task_used_math->thread.fpr overwriting the just restored state.
Should the last_task_used_math nullifying, etc. be moved to the front of
the function instead, or am I overlooking something?
-- Heikki Lindholm
^ permalink raw reply
* Re: Segmentation fault with X.org and Coral-P drivers
From: Matthias Transier @ 2006-01-04 17:59 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-embedded
In-Reply-To: <b789c2e60601040819j65eea749p@mail.gmail.com>
Hi Wolfgang,
it finally works :-). I had to make a small modification to the x.org
source code. The file xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c
contains the initialization of the i2c bus. In function
xf86I2CBusInit, I added the two lines near the beginning:
if (b->I2CStart =3D=3D NULL)
b->I2CStart =3D I2CStart;
which sets the start function to a default function. The problem was
that mb86290_i2c.c does not provide a start function, whereas
xf86I2CBusInit expects one under some circumstances.
Best regards,
Matthias
^ permalink raw reply
* Re: Segmentation fault with X.org and Coral-P drivers
From: Matthias Transier @ 2006-01-04 16:19 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-embedded
In-Reply-To: <20060104154812.24858352B1E@atlas.denx.de>
Hi Wolfgang,
thanks for the quick response.
2006/1/4, Wolfgang Denk <wd@denx.de>:
> > I have been trying to get X.org running on a board called "Embedded
> > Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu
>
> Umm... no. Embedded Plaet and Freescale are two different companies,
> and EP5200 and Lite5200 are two different boards.
Ok, my fault. I saw a Lite5200 on a picture somewhere and it looked
pretty much like my EP board :-). But what I can tell for sure is:
when I remove the "Embedded Planet" sticker on the board, there is a
Freescale logo and a print (directly on the board): "IceCube Version
103"
> > Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and
>
> Our kernel does not include any support for the EP5200 board.
I checked it out from CVS, configured it, and it works (besides the X11 thi=
ng).
> > succesfully installed gentoo-ppc on nfs. The framebuffer works, I get
> > a login prompt on the monitor.
> >
> > Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from
> > denx.de. Unfortunately, it does not work and I get a segmentation
> > fault when trying to startx. strace produces the output attached
> > below.
>
> Please read the documentation that comes with the driver:
> ftp://ftp.denx.de/pub/fujitsu/Coral-P/README.html
That is what I already read in order to compile the driver.
> Note that the driver was built and tested against xfree86-4.3.0;
> don't expect the binary to work in a completely different X11
> release. You wil have to rebuild (and eventually adapt) the driver
> for your environment.
I did not use the prebuilt binaries, but I was able to compile the
driver within my x.org tree. (I had to adapt the Imakefiles by myself,
the provided ones were too different from the originals.)
In the meantime, I can provide you with further debugging information:
from Xorg.0.log:
=3D=3D=3D=3D=3D=3D
(II) MB86290(0): Using XFree86 Acceleration Architecture (XAA)
Screen to screen bit blits
Solid filled rectangles
8x8 mono pattern filled rectangles
Indirect CPU to Screen color expansion
Solid Lines
Dashed Lines
(II) MB86290(0): Acceleration enabled
fbdevHW: LoadPalette 0
(II) MB86290(0): fbdevHWLoadPalette succeeded
=3D=3D=3D=3D=3D=3D
The last line is a message that I added. Since the output stops at
that point, it must be the next call that fails
(mb86290_driver.c:604):
if (!xf86I2CProbeAddress(fPtr->I2C, I2C_SAA7113))
return FALSE;
May that be a problem with the i2c driver in the kernel which does not
exactly fit with my board?
The following message also appears in Xorg.0.log, some lines above:
(II) MB86290(0): I2C bus "MB86290 I2C bus" removed.
Thanks in advance for any hint that you can give me.
Best regards,
Matthias
^ permalink raw reply
* Re: Segmentation fault with X.org and Coral-P drivers
From: Wolfgang Denk @ 2006-01-04 15:48 UTC (permalink / raw)
To: Matthias Transier; +Cc: linuxppc-embedded
In-Reply-To: <b789c2e60601040333o42d64c52n@mail.gmail.com>
Dear Matthias,
in message <b789c2e60601040333o42d64c52n@mail.gmail.com> you wrote:
>
> I have been trying to get X.org running on a board called "Embedded
> Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu
Umm... no. Embedded Plaet and Freescale are two different companies,
and EP5200 and Lite5200 are two different boards.
> Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and
Our kernel does not include any support for the EP5200 board.
> succesfully installed gentoo-ppc on nfs. The framebuffer works, I get
> a login prompt on the monitor.
>
> Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from
> denx.de. Unfortunately, it does not work and I get a segmentation
> fault when trying to startx. strace produces the output attached
> below.
Please read the documentation that comes with the driver:
ftp://ftp.denx.de/pub/fujitsu/Coral-P/README.html
Note that the driver was built and tested against xfree86-4.3.0;
don't expect the binary to work in a completely different X11
release. You wil have to rebuild (and eventually adapt) the driver
for your environment.
Feel free to contact me if you need help.
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
What can it profit a man to gain the whole world and to come to his
property with a gastric ulcer, a blown prostate, and bifocals?
-- John Steinbeck, _Cannery Row_
^ permalink raw reply
* Re: question about arch_initcall()
From: Kumar Gala @ 2006-01-04 15:00 UTC (permalink / raw)
To: Nathael Pajani; +Cc: linuxppc-embedded
In-Reply-To: <20060104110440.13a4dc16.nathael.pajani@cpe.fr>
Its like any other init call.
As for order look at include/linux/init.h
core_initcall() first and late_initcall() last.
There is no guarntee of the order in which functions are called =20
inside one group.
- kumar
On Jan 4, 2006, at 4:04 AM, Nathael Pajani wrote:
> Hi all
>
> I would like to know how this macro is used, and when is called the =20=
> function registered with it.
>
> thanks for all.
>
>
> ----
> Nathael PAJANI
> Ing=E9nieur CPE Lyon
> nathael.pajani@cpe.fr
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: "argument list too long"
From: Stefan Eletzhofer @ 2006-01-04 13:53 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Linuxppc-embedded
In-Reply-To: <20060104133618.0020E352B1E@atlas.denx.de>
[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]
Am Mittwoch, den 04.01.2006, 14:36 +0100 schrieb Wolfgang Denk:
> In message <1136380085.15908.15.camel@localhost> you wrote:
> >
> > > + find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
> > > scripts/mkdep -- init/*.c > .depend
> >
> > Would'nt this overwrite .depend if xargs executes mkdep more than once?
>
> No, why should it? The filr eredirection happens just once, in the
> shell, even before xargs gets executed. It does not matter how often
> mkdep gets called then.
Gah. You're right, of course ;/
>
> > I'd suggest (beware, manually hacked diff ;):
>
> I have no idea what you're trying to fix or improve with this.
"problem is in front of keyboard" Oder so.
>
> Best regards,
>
> Wolfgang Denk
>
--
Stefan Eletzhofer
InQuant GmbH
Bahnhofstraße 11
D-88214 Ravensburg
http://www.inquant.de
http://www.eletztrick.de
+49 (0) 751 35 44 112
+49 (0) 171 23 24 529 (Mobil)
+49 (0) 751 35 44 115 (FAX)
[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: Cross Compiling driver for PPC
From: Nathael Pajani @ 2006-01-04 13:44 UTC (permalink / raw)
To: linuxppc-embedded
Hi
> We are trying to port a newly developed device driver for powerPC .
> We are unable to compile it for powerpc driver on Host platform.
> Please give us the way to compile the device driver
=20
You need to cross compile, which means having a ggc for powerpc in addition=
to the gcc you have for your developpement machine.
I do not know whether you will find it on the net, usualy you have to recom=
pile gcc (and "ld" and "ar" and so on, the whole gcc toolchain I think) wit=
h specific options
Then you will have a powerpc-linux-gcc (for example) which will be able to =
compile for powerpc
then, you will have some modifications to do in the makefiles: look for thi=
s string: "CROSS_COMPILE" and set it to "powerpc-linux-" (or whatever is th=
e prefix for you gcc).
I also created a ".arch" file at the base of the source tree, containing "p=
pc" and some other modifications in makefiles, but I cannot tell you wich..=
. and wether they are usefull. You'll have to try.
Then add "ARCH=3Dppc" option to the make command when you want to compile y=
our kernel for powerpc.
Have fun.
+++
----=20
Nathael PAJANI
Ing=E9nieur CPE Lyon
nathael.pajani@cpe.fr
^ permalink raw reply
* Re: "argument list too long"
From: Wolfgang Denk @ 2006-01-04 13:36 UTC (permalink / raw)
To: stefan.eletzhofer; +Cc: Linuxppc-embedded
In-Reply-To: <1136380085.15908.15.camel@localhost>
In message <1136380085.15908.15.camel@localhost> you wrote:
>
> > + find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
> > scripts/mkdep -- init/*.c > .depend
>
> Would'nt this overwrite .depend if xargs executes mkdep more than once?
No, why should it? The filr eredirection happens just once, in the
shell, even before xargs gets executed. It does not matter how often
mkdep gets called then.
> I'd suggest (beware, manually hacked diff ;):
I have no idea what you're trying to fix or improve with this.
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
For every complex problem, there is a solution that is simple, neat,
and wrong. - Mark Twain
^ permalink raw reply
* Re: "argument list too long"
From: Stefan Eletzhofer @ 2006-01-04 13:08 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Linuxppc-embedded
In-Reply-To: <20060103141725.08E8D3540BC@atlas.denx.de>
[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]
Hi,
Am Dienstag, den 03.01.2006, 15:17 +0100 schrieb Wolfgang Denk:
> In message <f8bc181b0601030606x3b29ee28q@mail.gmail.com> you wrote:
> >
> > After a few minutes of dependency creation, I get the following error
> > "argument list too long":
> >
> > scripts/mkdep -- `find
> > /usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/asm
> > /usr/src/linuxppc_2_4
> > _devel-2005-10-25-1440/include/linux
> > /usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/scsi /usr/s
> > rc/linuxppc_2_4_devel-2005-10-25-1440/include/net
> > /usr/src/linuxppc_2_4_devel-2005-10-25-1440/includ
> > e/math-emu \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h !
> > -name modversions.h -print`
> > > .hdepend
> > scripts/mkdep: argument list too long
> > make: *** [dep-files] Error 2
> >
> > Can someone help me understand where that comes from?
>
> The error comes from the fact that the find command (the part in
> `...` above) generates a long list of file names which exceeds some
> buffer in your shell.
>
> > Does it have something to do with the fact that I work under WinXP + Cygwin?
>
> Yes.
>
> > No need to say that I am a newbie to the Linux world... help me, Wolfgang
> > :-)
>
> I try. Find the statement in the Makefile and use xargs to avoid a
> long argument list. Something like this might help:
>
> --- Makefile.ORIG 2006-01-03 15:15:48.000000000 +0100
> +++ Makefile 2006-01-03 15:16:55.000000000 +0100
> @@ -503,7 +503,7 @@
> ifdef CONFIG_MODVERSIONS
> $(MAKE) update-modverfile
> endif
> - scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
> + find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
> scripts/mkdep -- init/*.c > .depend
Would'nt this overwrite .depend if xargs executes mkdep more than once?
I'd suggest (beware, manually hacked diff ;):
--- Makefile.ORIG 2006-01-03 15:15:48.000000000 +0100
+++ Makefile 2006-01-03 15:16:55.000000000 +0100
@@ -503,7 +503,7 @@
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
endif
- scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
+ rm -f .depend && find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
scripts/mkdep -- init/*.c >> .depend
>
> ifdef CONFIG_MODVERSIONS
>
>
>
> Best regards,
>
> Wolfgang Denk
>
--
Stefan Eletzhofer
InQuant GmbH
Bahnhofstraße 11
D-88214 Ravensburg
http://www.inquant.de
http://www.eletztrick.de
+49 (0) 751 35 44 112
+49 (0) 171 23 24 529 (Mobil)
+49 (0) 751 35 44 115 (FAX)
[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Segmentation fault with X.org and Coral-P drivers
From: Matthias Transier @ 2006-01-04 11:33 UTC (permalink / raw)
To: linuxppc-embedded
Hello everybody,
I have been trying to get X.org running on a board called "Embedded
Planet EP5200C" (it seems to be a "Freescale Lite5200") and a Fujitsu
Coral-P (Rev 5.0). I am using the 2.4 kernel from denx.de and
succesfully installed gentoo-ppc on nfs. The framebuffer works, I get
a login prompt on the monitor.
Now I compiled x.org-6.8.2 (gentoo -r4) and the mb86290 driver from
denx.de. Unfortunately, it does not work and I get a segmentation
fault when trying to startx. strace produces the output attached
below.
Can anybody give me a hint how to proceed?
Regards,
Matthias
[...]
mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0) =3D 0x30042000
ioctl(6, FBIOGET_VSCREENINFO, 0x105dfa58) =3D 0
ioctl(6, FBIOPUT_VSCREENINFO, 0x105df9b8) =3D 0
ioctl(6, FBIOGET_FSCREENINFO, 0x105df974) =3D 0
ioctl(6, FBIOGET_VSCREENINFO, 0x105df9b8) =3D 0
ioctl(6, FBIOBLANK, 0x1) =3D 0
ioctl(6, FBIOPAN_DISPLAY, 0x105df9b8) =3D 0
write(0, "(=3D=3D) MB86290(0): Backing store d"..., 40) =3D 40
write(0, "(II) MB86290(0): Using XFree86 A"..., 63) =3D 63
write(0, "\tScreen to screen bit blits\n", 28) =3D 28
write(0, "\tSolid filled rectangles\n", 25) =3D 25
write(0, "\t8x8 mono pattern filled rectang"..., 36) =3D 36
write(0, "\tIndirect CPU to Screen color ex"..., 40) =3D 40
write(0, "\tSolid Lines\n", 13) =3D 13
write(0, "\tDashed Lines\n", 14) =3D 14
write(0, "(II) MB86290(0): Acceleration en"..., 38) =3D 38
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
ioctl(6, FBIOPUTCMAP, 0x7ffff930) =3D 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
rt_sigaction(SIGSEGV, {SIG_IGN}, {0x100424d0, [SEGV], SA_RESTART}, 8) =3D 0
write(2, "\n *** If unresolved symbols we"..., 112
[...]
^ permalink raw reply
* [AGPGART] Attempting to create a agpgart driver for ArticiaS, help appreciated!
From: dabby bentam @ 2006-01-04 10:51 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
This is a long shot.
Between me and geri pircher we are trying to get the agpgart driver working
for the pegasos 1 and amigaone boards (using the ArticiaS northbridge
http://www.mai.com).
Find the attached source file (articias-agp.c), You might need to remove the
debug code.
So far, the aperture size works and is detected as 204m, but the gatt table
cannot allocate any memory - complains that ioremap is using memory from
RAM.
The ArticiaS masks its bridge memory (i'm sure the uninorth does the same?).
Is there anyway to find out the mask memory, or is the code completly wrong?
This source code should work on 2.6 kernel.
Thanks for any help or guidence in advance.
PegXlin Developer
Pegxmac, Pegxlin
Versatile LIVE CD's for Pegasos Mainboards
http://pegxmac.zftp.com
http://www.pegasosppc.com
[-- Attachment #2: articias-agp.c --]
[-- Type: application/octet-stream, Size: 27262 bytes --]
/*
* ArticiaS AGPGART routines.
*/
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/agp_backend.h>
#include "agp.h"
static struct pci_device_id agp_articias_pci_table[];
#define ARTICIAS_DEBUG
#define ARTICIAS_AGP_EN 0x49 /* bit 0 -> AGP enable */
#define ARTICIAS_GART_EN 0x58 /* bit 6 -> GART enable */
#define ARTICIAS_APSIZE 0x59 /* bits 2:0 set size */
#define ARTICIAS_APBASE 0x59 /* TLB address Base [31:12]*/
#define ARTICIAS_GATTBASE 0x10 /* GART base address register */
#define ARTICIAS_TLB_BASE 0x5A /* bits 16:31 of TLB base address */
#define ARTICIAS_GATT_MASK 0xFFFFF000 /* Geri: new mask. */
#define ARTICIAS_SIZE_MASK 0x07 /* Mask aperture size bits. */
#define ARTICIAP_SIZE_MASK 0x0F /* not yet used - vaporware IC. */
/* Original code from MAI. */
// #define ARTICIAS_GATTBASE 0x12 /* GART base address register */
// #define ARTICIAS_GATT_MASK 0xF0000000 /* MAI says fix me! */
static int articias_fetch_size(void)
{
int i;
u8 temp;
struct aper_size_info_8 *values;
values = A_SIZE_8(agp_bridge->driver->aperture_sizes);
pci_read_config_byte(agp_bridge->dev, ARTICIAS_APSIZE, &temp);
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] articias_fetch_size()\n");
printk(KERN_INFO PFX "[ARTICIAS] * non masked temp = 0x%x\n", temp);
#endif
/* Mask the GART/Aperture size selection bits. */
temp = temp & ARTICIAS_SIZE_MASK;
for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) {
#ifdef ARTICIAS_DEBUG
void *temp2;
printk(KERN_INFO PFX "[ARTICIAS] * aperature size loop index #%d\n", i);
printk(KERN_INFO PFX "[ARTICIAS] * values[%d].size_value = %x\n", i, (u32) values[i].size_value);
#endif
if (temp == values[i].size_value) {
agp_bridge->previous_size =
agp_bridge->current_size = (void *) (values + i);
/* Geri: Was <(void *) (values)> before, but that
* didn't make sense to me!? Otherwise it would always
* point to the same value!
*/
agp_bridge->aperture_size_idx = i;
#ifdef ARTICIAS_DEBUG
temp2 = agp_bridge->current_size;
printk(KERN_INFO PFX "[ARTICIAS] * masked temp = 0x%x\n", temp);
printk(KERN_INFO PFX "[ARTICIAS] * values[%d].size = %d\n", i, values[i].size);
printk(KERN_INFO PFX "[ARTICIAS] * current_size->size = %d\n", A_SIZE_8(temp2)->size);
printk(KERN_INFO PFX "[ARTICIAS] * current_size->page_order = %d\n", A_SIZE_8(temp2)->page_order);
printk(KERN_INFO PFX "[ARTICIAS] * current_size->num_entries = %d\n", A_SIZE_8(temp2)->num_entries);
printk(KERN_INFO PFX "[ARTICIAS] * current_size->size_value = %d\n", A_SIZE_8(temp2)->size_value);
#endif
return values[i].size;
}
}
printk(KERN_ERR PFX "Unknown aperture size from AGP bridge (0x%x)\n", temp);
return 0;
}
static int articias_configure(void)
{
u32 temp = 0;
u16 shift = 0;
struct aper_size_info_8 *current_size;
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] articias_configure()\n");
#endif
/* Get current aperture size */
current_size = A_SIZE_8(agp_bridge->current_size);
temp = (u32) agp_bridge->gatt_table_real;
/* Get upper word from dword. Note that the ArticiaS should have 20
* bits for the TLB base address. Otherwise the PCI write config code
* for the aperture size below doesn't make sense!?
*/
shift = (u16) (temp>>16);
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] * temp = 0x%x, shift = 0x%x\n", temp, shift);
#endif
pci_write_config_word(agp_bridge->dev, ARTICIAS_TLB_BASE, shift);
/* Original code from MAI. */
/*
pci_write_config_word(agp_bridge->dev, ARTICIAS_APSIZE, (shift & current_size->size_value));
*/
/* Geri: I can't figure out how they want to configure the rest of the
* 20 bits TLB base address in the config register for the aperture
* size, so here is my code.
*/
/* Get the byte 1 from dword and mask it out with the aperture size. */
shift = (u16) (temp>>8);
shift &= ~(ARTICIAS_SIZE_MASK);
shift |= current_size->size_value;
pci_write_config_byte(agp_bridge->dev, ARTICIAS_APBASE, (u8) shift);
/* Original code from MAI. Get address to map too */
/*
pci_read_config_word(agp_bridge->dev, ARTICIAS_GATTBASE, (void *)&temp);
temp = temp & ARTICIAS_GATT_MASK;
*/
/* Get address to map too */
pci_read_config_dword(agp_bridge->dev, ARTICIAS_GATTBASE, (void *)&temp);
temp = temp & ARTICIAS_GATT_MASK;
agp_bridge->gart_bus_addr = temp;
/* GART control register */
/* Enable GART and bus concurrency */
pci_write_config_byte(agp_bridge->dev, ARTICIAS_GART_EN, 0x41);
/* Enable AGP operation */
pci_write_config_byte(agp_bridge->dev, ARTICIAS_AGP_EN, 0x01);
return 0;
}
static void articias_cleanup(void)
{
struct aper_size_info_8 *previous_size;
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] articias_cleanup()\n");
#endif
previous_size = A_SIZE_8(agp_bridge->previous_size);
pci_write_config_byte(agp_bridge->dev, ARTICIAS_APSIZE,
previous_size->size_value);
}
static void articias_tlbflush(struct agp_memory *mem)
{
/* pci_write_config_dword(agp_bridge->dev, ARTICIAS_GARTCTRL, 0x0000008f);
pci_write_config_dword(agp_bridge->dev, ARTICIAS_GARTCTRL, 0x0000000f);
*/
/* Geri: We need to do something here. There is a AGP TLB translation
* control bit (0x58:7) specified in the ArticiaP datasheet which may
* control TLB flushes. We have to check, if it exists also in the
* ArticiaS.
*/
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] agp_tlbflush()\n");
#endif
return;
}
static struct aper_size_info_8 articias_generic_sizes[7] =
{
/* size, num_entries, page_order, size_value */
/* Geri: added 256MB aperture size value. I think these are MB values,
* because the ArticiaP supports aperture sizes from 4kB to 256MB, but
* the default value is set to 4MB. Let's hope that the ArticiaS
* supports aperture sizes from 4MB to 256MB.
*/
{4, 1024, 1, 1},
{8, 2048, 1, 2},
{16, 4096, 2, 3},
{32, 8192, 3, 4},
{64, 16384, 4, 5},
{128, 32768, 5, 6},
{256, 65536, 6, 7},
/* Original code from MAI. */
/*
{4, 1024, 1, 1},
{8, 2048, 1, 2},
{16, 4096, 2, 3},
{32, 8192, 3, 4},
{64, 16384, 4, 5},
{128, 32768, 5, 6}
*/
};
static unsigned long articias_mask_memory(unsigned long addr, int type)
{
/* Memory type is ignored */
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] articias_mask_memory()\n");
#endif
return addr | agp_bridge->driver->masks[0].mask;
}
static struct gatt_mask articias_generic_masks[] =
{
/* Original code from MAI. */
{0x00000000, 0}
};
static struct agp_bridge_driver articias_driver = {
.owner = THIS_MODULE,
.aperture_sizes = articias_generic_sizes,
.size_type = U8_APER_SIZE,
/* Geri: Was 6 before. Added 256k entry for aperture size. */
.num_aperture_sizes = 7,
.configure = articias_configure,
.fetch_size = articias_fetch_size,
.cleanup = articias_cleanup,
.tlb_flush = articias_tlbflush,
.mask_memory = articias_mask_memory,
.masks = articias_generic_masks,
.agp_enable = agp_generic_enable,
.cache_flush = global_cache_flush,
.create_gatt_table = agp_generic_create_gatt_table,
.free_gatt_table = agp_generic_free_gatt_table,
.insert_memory = agp_generic_insert_memory,
.remove_memory = agp_generic_remove_memory,
.alloc_by_type = agp_generic_alloc_by_type,
.free_by_type = agp_generic_free_by_type,
.agp_alloc_page = agp_generic_alloc_page,
.agp_destroy_page = agp_generic_destroy_page,
};
static struct agp_device_ids articias_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_MAI_ARTICIAS,
.chipset_name = "ArticiaS",
},
{ }, /* dummy final entry, always present */
};
static int __devinit agp_articias_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct agp_device_ids *devs = articias_agp_device_ids;
struct agp_bridge_data *bridge;
int j = 0;
u8 cap_ptr;
cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
if (!cap_ptr)
return -ENODEV;
j = ent - agp_articias_pci_table;
printk (KERN_INFO PFX "Detected %s chipset\n", devs[j].chipset_name);
bridge = agp_alloc_bridge();
if (!bridge)
return -ENOMEM;
#ifdef ARTICIAS_DEBUG
/* Geri: Print all AGP relevant registers of the ArticiaS. */
printk(KERN_INFO PFX "[ARTICIAS] articias_print_agp_register()\n");
#endif
bridge->dev = pdev;
bridge->capndx = cap_ptr;
bridge->driver = &articias_driver;
return agp_add_bridge(bridge);
}
static void __devexit agp_articias_remove(struct pci_dev *pdev)
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
agp_remove_bridge(bridge);
agp_put_bridge(bridge);
}
#ifdef CONFIG_PM
static int agp_articias_suspend(struct pci_dev *pdev, pm_message_t state)
{
pci_save_state (pdev);
pci_set_power_state (pdev, PCI_D3hot);
return 0;
}
static int agp_articias_resume(struct pci_dev *pdev)
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
pci_set_power_state (pdev, PCI_D0);
pci_restore_state(pdev);
if (bridge->driver == &articias_driver)
return articias_configure();
return 0;
}
#endif /* CONFIG_PM */
/* must be the same order as name table above */
static struct pci_device_id agp_articias_pci_table[] = {
#define ID(x) \
{ \
.class = (PCI_CLASS_BRIDGE_HOST << 8), \
.class_mask = ~0, \
.vendor = PCI_VENDOR_ID_MAI, \
.device = x, \
.subvendor = PCI_ANY_ID, \
.subdevice = PCI_ANY_ID, \
}
ID(PCI_DEVICE_ID_MAI_ARTICIAS),
{ }
};
MODULE_DEVICE_TABLE(pci, agp_articias_pci_table);
static struct pci_driver agp_articias_pci_driver = {
.name = "agpgart-articias",
.id_table = agp_articias_pci_table,
.probe = agp_articias_probe,
.remove = agp_articias_remove,
#ifdef CONFIG_PM
.suspend = agp_articias_suspend,
.resume = agp_articias_resume,
#endif
};
static int __init agp_articias_init(void)
{
if (agp_off)
{
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] agp_articias_init return EINVAL.\n");
#endif
return -EINVAL;
}
#ifdef ARTICIAS_DEBUG
printk(KERN_INFO PFX "[ARTICIAS] agp_articias_init return pci driver struct.\n");
#endif
return pci_register_driver(&agp_articias_pci_driver);
}
static void __exit agp_articias_cleanup(void)
{
pci_unregister_driver(&agp_articias_pci_driver);
}
/* Debug function to check ArticiaS's AGP register configuration. Call before
* any AGP functionality is enabled! Otherwise it will destroy the previous
* configuration!
*/
static void articias_test_agp_register(struct pci_dev *pdev)
{
printk(KERN_INFO PFX "[ARTICIAS] articias_test_agp_register().\n");
printk(KERN_INFO PFX "[ARTICIAS] RW Addr Register Value\n");
printk(KERN_INFO PFX "[ARTICIAS] -----------------------------------------\n);
/* R = Read
* W = Write
* RO = Read only - no write test
* RT = Read test value
*/
/* Test register address space 0x10..0x13. */
u32 agp_gart_base_dword_init = 0;
u32 agp_gart_base_dword_test = 0;
/* Read out initial AGP GART base register configuration. */
pci_read_config_dword(pdev, 0x10, (void *)&agp_gart_base_dword_init);
printk(KERN_INFO PFX "[ARTICIAS] R 0x10 agp_gart_base 0x%x\n", (u32)agp_gart_base_dword_init);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 GART memory space\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:1 GART addess type\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3 Memory prefetch\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:4 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 GART base address\n");
/* Write register to find out bit assignments in the register. */
/* Mask register init value with new settings. */
agp_gart_base_dword_test = agp_gart_base_dword_init | 0xFFFFF000;
printk(KERN_INFO PFX "[ARTICIAS] W 0x10 agp_gart_base 0x%x\n", (u32)agp_gart_base_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 GART memory space def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:1 GART addess type def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3 Memory prefetch def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:4 Reserved def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 GART base address 0xFFFFF\n");
pci_write_config_dword(pdev, 0x10, agp_gart_base_dword_test);
agp_gart_base_dword_test = 0;
/* Read back the register test configuration. */
pci_read_config_dword(pdev, 0x10, (void *)&agp_gart_base_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] RT 0x10 agp_gart_base 0x%x\n", (u32)agp_gart_base_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 GART memory space def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:1 GART addess type def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3 Memory prefetch def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:4 Reserved def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 GART base address 0xFFFFF\n");
agp_gart_base_dword_test = 0;
/* Restore initial register content. */
pci_write_config_dword(pdev, 0x10, agp_gart_base_dword_init);
pci_read_config_dword(pdev, 0x10, (void *)&agp_gart_base_dword_test);
if(agp_gart_base_dword_test != agp_gart_dword_init)
{
printk(KERN_INFO PFX "[ARTICIAS] ERROR: Could not restore initial register setting!\n");
}
/* Output capability pointer register. */
u8 byte_registers = 0;
pci_read_config_byte(pdev, 0x34, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x34 cap_pointer 0x%x\n", (u8)byte_registers);
/* Output capability identifier register. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x40, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x40 cap_identifier 0x%x\n", (u8)byte_registers);
/* Output AGP interface specification revision number. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x42, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x42 agp_int_rev 0x%x\n", (u8)byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3:0 AGP interface spec minor rev\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:4 AGP interface spec major rev\n");
/* Output AGP operation status 0/1 register. */
u16 word_registers = 0;
pci_read_config_word(pdev, 0x44, (void *)&word_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x44 agp_op_stat01 0x%x\n", (u16)word_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 AGP 1X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP 2X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 AGP 4X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 AGP Sideband Addressing support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved\n");
/* Output AGP operation status 2 register. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x47, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x47 agp_op_stat2 0x%x\n", (u8)byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:0 AGP maximum number of commands\n");
/* Test AGP command register. */
u16 agp_cmd_word_init = 0;
u16 agp_cmd_word_test = 0;
/* Read out initial AGP command register configuration. */
pci_read_config_word(pdev, 0x48, (void *)&agp_cmd_word_init);
printk(KERN_INFO PFX "[ARTICIAS] R 0x48 agp_cmd 0x%x\n", (u16)agp_cmd_word_init);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:0 AGP 1x/2x/4x\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8 AGP operation\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 SBAddressing\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved\n");
/* Write register to find out bit assignments in the register. */
/* Mask register init value with new settings. We leave the AGP
* transfer rate as it is, because we know that the ArticiaS only
* supports 1x and 2x transfer rates. Also we don't set the AGP
* operation enable bit, because AGP mode is not setup yet!
*/
agp_cmd_word_test = agp_cmd_word_init | 0xFEF8;
printk(KERN_INFO PFX "[ARTICIAS] W 0x48 agp_cmd 0x%x\n", (u16)agp_cmd_word_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:0 AGP 1x/2x/4x def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:3 Reserved 0xFF\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8 AGP operation def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 SBAddressing 0x1\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved 0xFF\n");
pci_write_config_word(pdev, 0x48, agp_cmd_word_test);
agp_cmd_word_test = 0;
/* Read back the register test configuration. */
pci_read_config_word(pdev, 0x48, (void *)&agp_cmd_word_test);
printk(KERN_INFO PFX "[ARTICIAS] RT 0x48 agp_cmd 0x%x\n", (u16)agp_cmd_word_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:0 AGP 1x/2x/4x 0x2\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:3 Reserved 0x00\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8 AGP operation 0x0\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 SBAddressing 0x1\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved 0x00\n");
agp_cmd_word_test = 0;
/* Restore initial register content. */
pci_write_config_word(pdev, 0x48, agp_cmd_word_init);
pci_read_config_word(pdev, 0x48, (void *)&agp_cmd_word_test);
if(agp_cmd_word_test != agp_cmd_word_init)
{
printk(KERN_INFO PFX "[ARTICIAS] ERROR: Could not restore initial register setting!\n");
}
/* Test bus 1 access control register (0x58-0x5B). */
u32 agp_bus1_dword_init = 0;
u32 agp_bus1_dword_test = 0;
/* Read out initial bus 1 access control register configuration. */
pci_read_config_dword(pdev, 0x58, (void *)&agp_bus1_dword_init);
printk(KERN_INFO PFX "[ARTICIAS] R 0x58 agp_bus1 0x%x\n", (u32)agp_bus1_dword_init);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 Byte enable check\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP extension mode\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 Graphic device AGP/PCI\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 5:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 6 GART transfer control\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7 AGP TLB translation control\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:8 GART size selection (\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 10:8 for ArticiaS(\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 AGP TLB base address\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 31:16 for ArticiaS?\n");
/* Write register to find out bit assignments in the register. */
/* Mask register init value with new settings. We set the AGP TLB base
* address (to check the size of the field), the AGP TLB translation
* control bit (because its not clear if the ArticiaS supports it) and
* the GART size selection bits.
*/
agp_bus1_dword_test = agp_bus1_dword_init | 0xFFFFFFB8;
printk(KERN_INFO PFX "[ARTICIAS] W 0x58 agp_bus1 0x%x\n", (u32)agp_bus1_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 Byte enable check def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP extension mode def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 Graphic device def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 5:3 Reserved 0x3\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 6 GART transfer def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7 AGP TLB transl. 0x1\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:8 GART size 0xF\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 10:8 for ArticiaS(\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 AGP TLB base 0FFFFF\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 31:16 for ArticiaS?\n");
pci_write_config_dword(pdev, 0x58, agp_bus1_dword_test);
agp_bus1_dword_test = 0;
/* Read back the register test configuration. */
pci_read_config_dword(pdev, 0x58, (void *)&agp_bus1_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] RT 0x58 agp_bus1 0x%x\n", (u32)agp_bus1_dword_test);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 Byte enable check def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP extension mode def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 Graphic device def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 5:3 Reserved 0x0\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 6 GART transfer def\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7 AGP TLB transl. 0x1\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:8 GART size 0x7\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 10:8 for ArticiaS(\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 AGP TLB base 0FFFF0\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 31:16 for ArticiaS?\n");;
agp_bus1_dword_test = 0;
/* Restore initial register content. */
pci_write_config_dword(pdev, 0x58, agp_bus1_dword_init);
pci_read_config_dword(pdev, 0x58, (void *)&agp_bus1_dword_test);
if(agp_bus1_dword_test != agp_bus1_dword_init)
{
printk(KERN_INFO PFX "[ARTICIAS] ERROR: Could not restore initial register setting!\n");
}
printk(KERN_INFO PFX "[ARTICIAS] End of articias_test_agp_register().\n");
}
static void articias_print_agp_register(struct pci_dev *pdev)
{
printk(KERN_INFO PFX "[ARTICIAS] articias_print_agp_register().\n");
printk(KERN_INFO PFX "[ARTICIAS] RW Addr Register Value\n");
printk(KERN_INFO PFX "[ARTICIAS] -----------------------------------------\n);
/* R = Read */
/* Output GART base address register (0x10..0x13). */
u32 dword_register = 0;
pci_read_config_dword(pdev, 0x10, (void *)&dword_register);
printk(KERN_INFO PFX "[ARTICIAS] R 0x10 agp_gart_base 0x%x\n", (u32)dword_register);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 GART memory space\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:1 GART addess type\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3 Memory prefetch\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:4 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 GART base address\n");
/* Output capability pointer register. */
u8 byte_registers = 0;
pci_read_config_byte(pdev, 0x34, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x34 cap_pointer 0x%x\n", (u8)byte_registers);
/* Output capability identifier register. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x40, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x40 cap_identifier 0x%x\n", (u8)byte_registers);
/* Output AGP interface specification revision number. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x42, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x42 agp_int_rev 0x%x\n", (u8)byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 3:0 AGP interface spec minor rev\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:4 AGP interface spec major rev\n");
/* Output AGP operation status 0/1 register. */
u16 word_registers = 0;
pci_read_config_word(pdev, 0x44, (void *)&word_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x44 agp_op_stat01 0x%x\n", (u16)word_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 AGP 1X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP 2X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 AGP 4X transfer rate support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 AGP Sideband Addressing support\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved\n");
/* Output AGP operation status 2 register. */
byte_registers = 0;
pci_read_config_byte(pdev, 0x47, (void *)&byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] RO 0x47 agp_op_stat2 0x%x\n", (u8)byte_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:0 AGP maximum number of commands\n");
/* Output AGP command register. */
word_registers = 0;
pci_read_config_word(pdev, 0x48, (void *)&word_registers);
printk(KERN_INFO PFX "[ARTICIAS] R 0x48 agp_cmd 0x%x\n", (u16)word_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2:0 AGP 1x/2x/4x\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 8 AGP operation\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 9 SBAddressing\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 15:10 Reserved\n");
/* Output bus 1 access control register (0x58-0x5B). */
dword_registers = 0;
pci_read_config_dword(pdev, 0x58, (void *)&dword_registers);
printk(KERN_INFO PFX "[ARTICIAS] R 0x58 agp_bus1 0x%x\n", (u32)dword_registers);
printk(KERN_INFO PFX "[ARTICIAS] * Decoding:\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 0 Byte enable check\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 1 AGP extension mode\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 2 Graphic device AGP/PCI\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 5:3 Reserved\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 6 GART transfer control\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 7 AGP TLB translation control\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 11:8 GART size selection (\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 10:8 for ArticiaS(\n");
printk(KERN_INFO PFX "[ARTICIAS] * Bit 31:12 AGP TLB base address\n");
printk(KERN_INFO PFX "[ARTICIAS] * >>> 31:16 for ArticiaS?\n");
}
module_init(agp_articias_init);
module_exit(agp_articias_cleanup);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
^ permalink raw reply
* question about arch_initcall()
From: Nathael Pajani @ 2006-01-04 10:04 UTC (permalink / raw)
To: linuxppc-embedded
Hi all
I would like to know how this macro is used, and when is called the functio=
n registered with it.
thanks for all.
----=20
Nathael PAJANI
Ing=E9nieur CPE Lyon
nathael.pajani@cpe.fr
^ permalink raw reply
* [PATCH] powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c
From: Kumar Gala @ 2006-01-03 22:15 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev
Only build in support for ISA and PCI cases if we have enabled CONFIG_ISA
and CONFIG_PCI. Additionally, isa_bridge is a global so we shouldn't use
it a parameter name since it gets redefined to NULL when !CONFIG_PCI.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
commit 010d770e4b04e159ce9841b4572224579b26ae22
tree a04b75607365053bf289edc0b76923bb86b06b5c
parent 8e80181ef9bf122ea5053e90cf9d9d0277c6e7ab
author Kumar Gala <galak@kernel.crashing.org> Tue, 03 Jan 2006 16:19:45 -0600
committer Kumar Gala <galak@kernel.crashing.org> Tue, 03 Jan 2006 16:19:45 -0600
arch/powerpc/kernel/legacy_serial.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 59164ba..f970ace 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -134,8 +134,9 @@ static int __init add_legacy_soc_port(st
return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags);
}
+#ifdef CONFIG_ISA
static int __init add_legacy_isa_port(struct device_node *np,
- struct device_node *isa_bridge)
+ struct device_node *isa_brg)
{
u32 *reg;
char *typep;
@@ -167,7 +168,9 @@ static int __init add_legacy_isa_port(st
return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF);
}
+#endif
+#ifdef CONFIG_PCI
static int __init add_legacy_pci_port(struct device_node *np,
struct device_node *pci_dev)
{
@@ -233,6 +236,7 @@ static int __init add_legacy_pci_port(st
*/
return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF);
}
+#endif
/*
* This is called very early, as part of setup_system() or eventually
@@ -272,6 +276,7 @@ void __init find_legacy_serial_ports(voi
of_node_put(soc);
}
+#ifdef CONFIG_ISA
/* First fill our array with ISA ports */
for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
struct device_node *isa = of_get_parent(np);
@@ -282,7 +287,9 @@ void __init find_legacy_serial_ports(voi
}
of_node_put(isa);
}
+#endif
+#ifdef CONFIG_PCI
/* Next, try to locate PCI ports */
for (np = NULL; (np = of_find_all_nodes(np));) {
struct device_node *pci, *parent = of_get_parent(np);
@@ -312,6 +319,7 @@ void __init find_legacy_serial_ports(voi
legacy_serial_console = index;
of_node_put(parent);
}
+#endif
DBG("legacy_serial_console = %d\n", legacy_serial_console);
@@ -375,6 +383,7 @@ static void __init fixup_port_pio(int in
struct device_node *np,
struct plat_serial8250_port *port)
{
+#ifdef CONFIG_PCI
struct pci_controller *hose;
DBG("fixup_port_pio(%d)\n", index);
@@ -391,6 +400,7 @@ static void __init fixup_port_pio(int in
index, port->iobase, port->iobase + offset);
port->iobase += offset;
}
+#endif
}
static void __init fixup_port_mmio(int index,
^ permalink raw reply related
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-03 19:25 UTC (permalink / raw)
To: Ben Collins
Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
Vojtech Pavlik, linux-input
In-Reply-To: <1136315929.14744.2.camel@grayson>
On Tue, Jan 03, 2006 at 02:18:49PM -0500, Ben Collins wrote:
> For it to be useful, you have to not initialize them (since they are
> static, they will be zero'd anyway). Initializing them defeats the
> purpose.
Dang, should have known that. I feel somewhat guilty having to send so
many patches. Anyway, here's another one with that small issue fixed:
---
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/Kconfig linux-2.6.15-rc7/drivers/usb/input/Kconfig
--- linux-2.6.15-rc7.orig/drivers/usb/input/Kconfig 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/Kconfig 2006-01-02 20:26:21.000000000 +0100
@@ -37,6 +37,16 @@ config USB_HIDINPUT
If unsure, say Y.
+config USB_HIDINPUT_POWERBOOK
+ bool "Enable support for iBook/PowerBook special keys"
+ default n
+ depends on USB_HIDINPUT
+ help
+ Say Y here if you want support for the special keys (Fn, Numlock) on
+ Apple iBooks and PowerBooks.
+
+ If unsure, say N.
+
config HID_FF
bool "Force feedback support (EXPERIMENTAL)"
depends on USB_HIDINPUT && EXPERIMENTAL
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid-core.c linux-2.6.15-rc7/drivers/usb/input/hid-core.c
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid-core.c 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid-core.c 2006-01-02 13:52:59.000000000 +0100
@@ -1580,6 +1580,14 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+ { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
+
{ 0, 0 }
};
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid-input.c linux-2.6.15-rc7/drivers/usb/input/hid-input.c
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid-input.c 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid-input.c 2006-01-03 20:21:00.000000000 +0100
@@ -63,6 +63,71 @@ static struct {
__s32 y;
} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
+struct hidinput_key_translation {
+ u16 from;
+ u16 to;
+ u8 flags;
+};
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+
+#define POWERBOOK_FLAG_FKEY 0x01
+
+static struct hidinput_key_translation powerbook_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F3, KEY_MUTE, POWERBOOK_FLAG_FKEY },
+ { KEY_F4, KEY_VOLUMEDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F5, KEY_VOLUMEUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F6, KEY_NUMLOCK, POWERBOOK_FLAG_FKEY },
+ { KEY_F7, KEY_SWITCHVIDEOMODE, POWERBOOK_FLAG_FKEY },
+ { KEY_F8, KEY_KBDILLUMTOGGLE, POWERBOOK_FLAG_FKEY },
+ { KEY_F9, KEY_KBDILLUMDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F10, KEY_KBDILLUMUP, POWERBOOK_FLAG_FKEY },
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { KEY_LEFT, KEY_HOME },
+ { KEY_RIGHT, KEY_END },
+ { }
+};
+
+static struct hidinput_key_translation powerbook_numlock_keys[] = {
+ { KEY_J, KEY_KP1 },
+ { KEY_K, KEY_KP2 },
+ { KEY_L, KEY_KP3 },
+ { KEY_U, KEY_KP4 },
+ { KEY_I, KEY_KP5 },
+ { KEY_O, KEY_KP6 },
+ { KEY_7, KEY_KP7 },
+ { KEY_8, KEY_KP8 },
+ { KEY_9, KEY_KP9 },
+ { KEY_M, KEY_KP0 },
+ { KEY_DOT, KEY_KPDOT },
+ { KEY_SLASH, KEY_KPPLUS },
+ { KEY_SEMICOLON, KEY_KPMINUS },
+ { KEY_P, KEY_KPASTERISK },
+ { KEY_MINUS, KEY_KPEQUAL },
+ { KEY_0, KEY_KPSLASH },
+ { KEY_F6, KEY_NUMLOCK },
+ { KEY_KPENTER, KEY_KPENTER },
+ { KEY_BACKSPACE, KEY_BACKSPACE },
+ { }
+};
+
+static int usbhid_pb_fkeyslast;
+module_param_named(pb_fkeyslast, usbhid_pb_fkeyslast, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_fkeyslast, "Use F keys only while pressing fn on PowerBooks");
+
+static int usbhid_pb_disablefnkeys;
+module_param_named(pb_disablefnkeys, usbhid_pb_disablefnkeys, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_disablefnkeys, "Disable fn special keys on PowerBooks");
+
+static int usbhid_pb_disablekeypad;
+module_param_named(pb_disablekeypad, usbhid_pb_disablekeypad, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_disablekeypad, "Disable keypad keys on PowerBooks");
+#endif
+
#define map_abs(c) do { usage->code = c; usage->type = EV_ABS; bit = input->absbit; max = ABS_MAX; } while (0)
#define map_rel(c) do { usage->code = c; usage->type = EV_REL; bit = input->relbit; max = REL_MAX; } while (0)
#define map_key(c) do { usage->code = c; usage->type = EV_KEY; bit = input->keybit; max = KEY_MAX; } while (0)
@@ -73,6 +138,85 @@ static struct {
#define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0)
#define map_ff_effect(c) do { set_bit(c, input->ffbit); } while (0)
+static inline struct hidinput_key_translation *find_translation(
+ struct hidinput_key_translation *table, u16 from)
+{
+ struct hidinput_key_translation *trans;
+
+ /* Look for the translation */
+ for(trans = table; trans->from && (trans->from != from); trans++);
+
+ return (trans->from?trans:NULL);
+}
+
+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
+ struct hid_usage *usage, __s32 value)
+{
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ struct hidinput_key_translation *trans;
+
+ if (usage->code == KEY_FN) {
+ if (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON;
+ else hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON;
+
+ input_event(input, usage->type, usage->code, value);
+
+ return 1;
+ }
+
+ if (!usbhid_pb_disablefnkeys) {
+ trans = find_translation(powerbook_fn_keys, usage->code);
+
+ if (trans) {
+ int do_translate;
+
+ if (test_bit(usage->code, hid->pb_fn))
+ do_translate = 1;
+ else if (trans->flags & POWERBOOK_FLAG_FKEY)
+ do_translate =
+ (!usbhid_pb_fkeyslast && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+ ( usbhid_pb_fkeyslast && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
+ else
+ do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
+
+ if (do_translate) {
+ if (value)
+ set_bit(usage->code, hid->pb_fn);
+ else
+ clear_bit(usage->code, hid->pb_fn);
+
+ input_event(input, usage->type, trans->to, value);
+
+ return 1;
+ }
+ }
+ }
+
+ if (!usbhid_pb_disablekeypad) {
+ int try_translate =
+ test_bit(usage->code, hid->pb_numlock)?1:
+ test_bit(LED_NUML, input->led);
+
+ if (try_translate) {
+ trans = find_translation(powerbook_numlock_keys, usage->code);
+
+ if (trans) {
+ if (value)
+ set_bit(usage->code, hid->pb_numlock);
+ else
+ clear_bit(usage->code, hid->pb_numlock);
+
+ input_event(input, usage->type, trans->to, value);
+ }
+
+ return 1;
+ }
+ }
+#endif
+
+ return 0;
+}
+
static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage)
{
@@ -325,7 +469,27 @@ static void hidinput_configure_usage(str
set_bit(EV_REP, input->evbit);
switch(usage->hid & HID_USAGE) {
- case 0x003: map_key_clear(KEY_FN); break;
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ /* The fn key on Apple PowerBooks */
+ case 0x0003: {
+ struct hidinput_key_translation *trans;
+
+ map_key_clear(KEY_FN);
+
+ set_bit(KEY_FN, input->keybit);
+ set_bit(KEY_NUMLOCK, input->keybit);
+
+ /* Enable all needed keys */
+ for(trans = powerbook_fn_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ for(trans = powerbook_numlock_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ goto ignore;
+ }
+#endif
+
default: goto ignore;
}
break;
@@ -482,6 +646,11 @@ void hidinput_hid_event(struct hid_devic
return;
}
+ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) &&
+ hidinput_pb_event(hid, input, usage, value)) {
+ return;
+ }
+
if (usage->hat_min < usage->hat_max || usage->hat_dir) {
int hat_dir = usage->hat_dir;
if (!hat_dir)
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid.h linux-2.6.15-rc7/drivers/usb/input/hid.h
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid.h 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid.h 2006-01-03 00:45:13.000000000 +0100
@@ -246,6 +246,8 @@ struct hid_item {
#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200
#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400
+#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
+#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
/*
* This is the global environment of the parser. This information is
@@ -431,6 +433,14 @@ struct hid_device { /* device repo
void (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */
int (*ff_event)(struct hid_device *hid, struct input_dev *input,
unsigned int type, unsigned int code, int value);
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ /* We do this here because it's only relevant for the
+ * USB devices, not for all input_dev's.
+ */
+ unsigned long pb_fn[NBITS(KEY_MAX)];
+ unsigned long pb_numlock[NBITS(KEY_MAX)];
+#endif
};
#define HID_GLOBAL_STACK_SIZE 4
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Ben Collins @ 2006-01-03 19:18 UTC (permalink / raw)
To: Michael Hanselmann
Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
Vojtech Pavlik, linux-input
In-Reply-To: <20060103191433.GA11169@hansmi.ch>
> +static int usbhid_pb_fkeyslast = 0;
> +module_param_named(pb_fkeyslast, usbhid_pb_fkeyslast, bool, 0644);
> +MODULE_PARM_DESC(usbhid_pb_fkeyslast, "Use F keys only while pressing fn on PowerBooks");
> +
> +static int usbhid_pb_disablefnkeys = 0;
> +module_param_named(pb_disablefnkeys, usbhid_pb_disablefnkeys, bool, 0644);
> +MODULE_PARM_DESC(usbhid_pb_disablefnkeys, "Disable fn special keys on PowerBooks");
> +
> +static int usbhid_pb_disablekeypad = 0;
> +module_param_named(pb_disablekeypad, usbhid_pb_disablekeypad, bool, 0644);
> +MODULE_PARM_DESC(usbhid_pb_disablekeypad, "Disable keypad keys on PowerBooks");
> +#endif
For it to be useful, you have to not initialize them (since they are
static, they will be zero'd anyway). Initializing them defeats the
purpose.
static int usbhid_pb_fkeyslast;
etc.
--
Ben Collins <ben.collins@ubuntu.com>
Developer
Ubuntu Linux
^ permalink raw reply
* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-03 19:14 UTC (permalink / raw)
To: Ben Collins
Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
Vojtech Pavlik, linux-input
In-Reply-To: <1136255354.27583.77.camel@grayson>
Hello Ben
On Mon, Jan 02, 2006 at 09:29:13PM -0500, Ben Collins wrote:
> I think these should be inverted to, something like
> pbook_disable_keypad, pbook_disable_fnkeys and pbook_fnfirst.
I've changed that in the patch below:
---
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/Kconfig linux-2.6.15-rc7/drivers/usb/input/Kconfig
--- linux-2.6.15-rc7.orig/drivers/usb/input/Kconfig 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/Kconfig 2006-01-02 20:26:21.000000000 +0100
@@ -37,6 +37,16 @@ config USB_HIDINPUT
If unsure, say Y.
+config USB_HIDINPUT_POWERBOOK
+ bool "Enable support for iBook/PowerBook special keys"
+ default n
+ depends on USB_HIDINPUT
+ help
+ Say Y here if you want support for the special keys (Fn, Numlock) on
+ Apple iBooks and PowerBooks.
+
+ If unsure, say N.
+
config HID_FF
bool "Force feedback support (EXPERIMENTAL)"
depends on USB_HIDINPUT && EXPERIMENTAL
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid-core.c linux-2.6.15-rc7/drivers/usb/input/hid-core.c
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid-core.c 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid-core.c 2006-01-02 13:52:59.000000000 +0100
@@ -1580,6 +1580,14 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+ { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
+ { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
+
{ 0, 0 }
};
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid-input.c linux-2.6.15-rc7/drivers/usb/input/hid-input.c
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid-input.c 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid-input.c 2006-01-03 19:57:26.000000000 +0100
@@ -63,6 +63,71 @@ static struct {
__s32 y;
} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
+struct hidinput_key_translation {
+ u16 from;
+ u16 to;
+ u8 flags;
+};
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+
+#define POWERBOOK_FLAG_FKEY 0x01
+
+static struct hidinput_key_translation powerbook_fn_keys[] = {
+ { KEY_BACKSPACE, KEY_DELETE },
+ { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F3, KEY_MUTE, POWERBOOK_FLAG_FKEY },
+ { KEY_F4, KEY_VOLUMEDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F5, KEY_VOLUMEUP, POWERBOOK_FLAG_FKEY },
+ { KEY_F6, KEY_NUMLOCK, POWERBOOK_FLAG_FKEY },
+ { KEY_F7, KEY_SWITCHVIDEOMODE, POWERBOOK_FLAG_FKEY },
+ { KEY_F8, KEY_KBDILLUMTOGGLE, POWERBOOK_FLAG_FKEY },
+ { KEY_F9, KEY_KBDILLUMDOWN, POWERBOOK_FLAG_FKEY },
+ { KEY_F10, KEY_KBDILLUMUP, POWERBOOK_FLAG_FKEY },
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { KEY_LEFT, KEY_HOME },
+ { KEY_RIGHT, KEY_END },
+ { }
+};
+
+static struct hidinput_key_translation powerbook_numlock_keys[] = {
+ { KEY_J, KEY_KP1 },
+ { KEY_K, KEY_KP2 },
+ { KEY_L, KEY_KP3 },
+ { KEY_U, KEY_KP4 },
+ { KEY_I, KEY_KP5 },
+ { KEY_O, KEY_KP6 },
+ { KEY_7, KEY_KP7 },
+ { KEY_8, KEY_KP8 },
+ { KEY_9, KEY_KP9 },
+ { KEY_M, KEY_KP0 },
+ { KEY_DOT, KEY_KPDOT },
+ { KEY_SLASH, KEY_KPPLUS },
+ { KEY_SEMICOLON, KEY_KPMINUS },
+ { KEY_P, KEY_KPASTERISK },
+ { KEY_MINUS, KEY_KPEQUAL },
+ { KEY_0, KEY_KPSLASH },
+ { KEY_F6, KEY_NUMLOCK },
+ { KEY_KPENTER, KEY_KPENTER },
+ { KEY_BACKSPACE, KEY_BACKSPACE },
+ { }
+};
+
+static int usbhid_pb_fkeyslast = 0;
+module_param_named(pb_fkeyslast, usbhid_pb_fkeyslast, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_fkeyslast, "Use F keys only while pressing fn on PowerBooks");
+
+static int usbhid_pb_disablefnkeys = 0;
+module_param_named(pb_disablefnkeys, usbhid_pb_disablefnkeys, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_disablefnkeys, "Disable fn special keys on PowerBooks");
+
+static int usbhid_pb_disablekeypad = 0;
+module_param_named(pb_disablekeypad, usbhid_pb_disablekeypad, bool, 0644);
+MODULE_PARM_DESC(usbhid_pb_disablekeypad, "Disable keypad keys on PowerBooks");
+#endif
+
#define map_abs(c) do { usage->code = c; usage->type = EV_ABS; bit = input->absbit; max = ABS_MAX; } while (0)
#define map_rel(c) do { usage->code = c; usage->type = EV_REL; bit = input->relbit; max = REL_MAX; } while (0)
#define map_key(c) do { usage->code = c; usage->type = EV_KEY; bit = input->keybit; max = KEY_MAX; } while (0)
@@ -73,6 +138,85 @@ static struct {
#define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0)
#define map_ff_effect(c) do { set_bit(c, input->ffbit); } while (0)
+static inline struct hidinput_key_translation *find_translation(
+ struct hidinput_key_translation *table, u16 from)
+{
+ struct hidinput_key_translation *trans;
+
+ /* Look for the translation */
+ for(trans = table; trans->from && (trans->from != from); trans++);
+
+ return (trans->from?trans:NULL);
+}
+
+static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
+ struct hid_usage *usage, __s32 value)
+{
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ struct hidinput_key_translation *trans;
+
+ if (usage->code == KEY_FN) {
+ if (value) hid->quirks |= HID_QUIRK_POWERBOOK_FN_ON;
+ else hid->quirks &= ~HID_QUIRK_POWERBOOK_FN_ON;
+
+ input_event(input, usage->type, usage->code, value);
+
+ return 1;
+ }
+
+ if (!usbhid_pb_disablefnkeys) {
+ trans = find_translation(powerbook_fn_keys, usage->code);
+
+ if (trans) {
+ int do_translate;
+
+ if (test_bit(usage->code, hid->pb_fn))
+ do_translate = 1;
+ else if (trans->flags & POWERBOOK_FLAG_FKEY)
+ do_translate =
+ (!usbhid_pb_fkeyslast && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+ ( usbhid_pb_fkeyslast && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
+ else
+ do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
+
+ if (do_translate) {
+ if (value)
+ set_bit(usage->code, hid->pb_fn);
+ else
+ clear_bit(usage->code, hid->pb_fn);
+
+ input_event(input, usage->type, trans->to, value);
+
+ return 1;
+ }
+ }
+ }
+
+ if (!usbhid_pb_disablekeypad) {
+ int try_translate =
+ test_bit(usage->code, hid->pb_numlock)?1:
+ test_bit(LED_NUML, input->led);
+
+ if (try_translate) {
+ trans = find_translation(powerbook_numlock_keys, usage->code);
+
+ if (trans) {
+ if (value)
+ set_bit(usage->code, hid->pb_numlock);
+ else
+ clear_bit(usage->code, hid->pb_numlock);
+
+ input_event(input, usage->type, trans->to, value);
+ }
+
+ return 1;
+ }
+ }
+#endif
+
+ return 0;
+}
+
static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage)
{
@@ -325,7 +469,27 @@ static void hidinput_configure_usage(str
set_bit(EV_REP, input->evbit);
switch(usage->hid & HID_USAGE) {
- case 0x003: map_key_clear(KEY_FN); break;
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ /* The fn key on Apple PowerBooks */
+ case 0x0003: {
+ struct hidinput_key_translation *trans;
+
+ map_key_clear(KEY_FN);
+
+ set_bit(KEY_FN, input->keybit);
+ set_bit(KEY_NUMLOCK, input->keybit);
+
+ /* Enable all needed keys */
+ for(trans = powerbook_fn_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ for(trans = powerbook_numlock_keys; trans->from; trans++)
+ set_bit(trans->to, input->keybit);
+
+ goto ignore;
+ }
+#endif
+
default: goto ignore;
}
break;
@@ -482,6 +646,11 @@ void hidinput_hid_event(struct hid_devic
return;
}
+ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) &&
+ hidinput_pb_event(hid, input, usage, value)) {
+ return;
+ }
+
if (usage->hat_min < usage->hat_max || usage->hat_dir) {
int hat_dir = usage->hat_dir;
if (!hat_dir)
diff -rNup linux-2.6.15-rc7.orig/drivers/usb/input/hid.h linux-2.6.15-rc7/drivers/usb/input/hid.h
--- linux-2.6.15-rc7.orig/drivers/usb/input/hid.h 2006-01-01 00:41:15.000000000 +0100
+++ linux-2.6.15-rc7/drivers/usb/input/hid.h 2006-01-03 00:45:13.000000000 +0100
@@ -246,6 +246,8 @@ struct hid_item {
#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x100
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x200
#define HID_QUIRK_2WHEEL_POWERMOUSE 0x400
+#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
+#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
/*
* This is the global environment of the parser. This information is
@@ -431,6 +433,14 @@ struct hid_device { /* device repo
void (*ff_exit)(struct hid_device*); /* Called by hid_exit_ff(hid) */
int (*ff_event)(struct hid_device *hid, struct input_dev *input,
unsigned int type, unsigned int code, int value);
+
+#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
+ /* We do this here because it's only relevant for the
+ * USB devices, not for all input_dev's.
+ */
+ unsigned long pb_fn[NBITS(KEY_MAX)];
+ unsigned long pb_numlock[NBITS(KEY_MAX)];
+#endif
};
#define HID_GLOBAL_STACK_SIZE 4
^ permalink raw reply
* Re: "argument list too long"
From: Wolfgang Denk @ 2006-01-03 14:17 UTC (permalink / raw)
To: Noé SERRES; +Cc: Linuxppc-embedded
In-Reply-To: <f8bc181b0601030606x3b29ee28q@mail.gmail.com>
In message <f8bc181b0601030606x3b29ee28q@mail.gmail.com> you wrote:
>
> After a few minutes of dependency creation, I get the following error
> "argument list too long":
>
> scripts/mkdep -- `find
> /usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/asm
> /usr/src/linuxppc_2_4
> _devel-2005-10-25-1440/include/linux
> /usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/scsi /usr/s
> rc/linuxppc_2_4_devel-2005-10-25-1440/include/net
> /usr/src/linuxppc_2_4_devel-2005-10-25-1440/includ
> e/math-emu \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h !
> -name modversions.h -print`
> > .hdepend
> scripts/mkdep: argument list too long
> make: *** [dep-files] Error 2
>
> Can someone help me understand where that comes from?
The error comes from the fact that the find command (the part in
`...` above) generates a long list of file names which exceeds some
buffer in your shell.
> Does it have something to do with the fact that I work under WinXP + Cygwin?
Yes.
> No need to say that I am a newbie to the Linux world... help me, Wolfgang
> :-)
I try. Find the statement in the Makefile and use xargs to avoid a
long argument list. Something like this might help:
--- Makefile.ORIG 2006-01-03 15:15:48.000000000 +0100
+++ Makefile 2006-01-03 15:16:55.000000000 +0100
@@ -503,7 +503,7 @@
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
endif
- scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
+ find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
scripts/mkdep -- init/*.c > .depend
ifdef CONFIG_MODVERSIONS
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
The optimum committee has no members.
- Norman Augustine
^ permalink raw reply
* "argument list too long"
From: Noé SERRES @ 2006-01-03 14:06 UTC (permalink / raw)
To: Linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
Hi,
I'm trying to compile a kernel for an embedded-powerpc-linux application.
As a first step/training, I followed closely the instructions of the
document "The DENX U-Boot and Linux Guide" for a TQM8XXL board, that is to
say:
bash$ mrproper
bash$ make TQM823L_config
bash$ make oldconfig
bash$ make dep
After a few minutes of dependency creation, I get the following error
"argument list too long":
scripts/mkdep -- `find
/usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/asm
/usr/src/linuxppc_2_4
_devel-2005-10-25-1440/include/linux
/usr/src/linuxppc_2_4_devel-2005-10-25-1440/include/scsi /usr/s
rc/linuxppc_2_4_devel-2005-10-25-1440/include/net
/usr/src/linuxppc_2_4_devel-2005-10-25-1440/includ
e/math-emu \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h !
-name modversions.h -print`
> .hdepend
scripts/mkdep: argument list too long
make: *** [dep-files] Error 2
Can someone help me understand where that comes from?
Does it have something to do with the fact that I work under WinXP + Cygwin?
No need to say that I am a newbie to the Linux world... help me, Wolfgang
:-)
Noe Serres
Midi Ingenierie
Toulouse (FR)
[-- Attachment #2: Type: text/html, Size: 1301 bytes --]
^ permalink raw reply
* Re: Re: Custom Driver
From: andreas_schmidt @ 2006-01-03 12:16 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <43B9F69B.6090407@secretlab.ca>
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
>Brett McNerney wrote:
>> I am need to create a driver to interface to custom hardware on a ml403
>> board. I am first trying to just create a ipif register bank and
access
>> the registers from linux but am not having any luck of yet. Has anyone
>> successfully done this and if so explain how or supply a driver to do
>> this and how to build it into the kernel? I am new at this and am
>> having great difficutly right now.
>>
>> Thanks for any help anyone can supply
>Can you access your device from a debugger, or a no-os program (like a
>bootloader)? Did you call ioremap() to map the physical register
>address into virtual memory? Can you give more detail?
I have already wrote I custom driver for Xilinx FPGA.
For this I have looked to already exist driver for Xilinx in Linux tree
and modify them for me.
It was no problem then.
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761
[-- Attachment #2: Type: text/html, Size: 1231 bytes --]
^ permalink raw reply
* Re: mv643xx_eth, sleeping function called from invalid context at mm/slab.c:2472
From: Olaf Hering @ 2006-01-03 9:54 UTC (permalink / raw)
To: Dale Farnsworth; +Cc: linuxppc-dev
In-Reply-To: <20051228224937.GA6320@xyzzy.farnsworth.org>
On Wed, Dec 28, Dale Farnsworth wrote:
> (For unknown reasons, I didn't receive this message directly from the
> mailing list, and the archive doesn't seem to have message-ids, so
> I can't supply a References: header.)
This doesnt help:
MV-643xx 10/100/1000 Ethernet Driver
eth1: port 1 with MAC address 00:2b:2f:de:ad:01
eth1: Scatter Gather Enabled
eth1: TX TCP/IP Checksumming Supported
eth1: RX TCP/UDP Checksum Offload ON
eth1: RX NAPI Enabled
eth1: Using SRAM
Debug: sleeping function called from invalid context at mm/slab.c:2472
in_atomic():0, irqs_disabled():1
Call Trace:
[C3E01D40] [C000BCAC] show_stack+0x54/0x184 (unreliable)
[C3E01D60] [C0028E68] __might_sleep+0xbc/0xd0
[C3E01D70] [C005FD3C] __kmalloc+0x88/0x158
[C3E01D90] [D2281264] mv643xx_eth_real_open+0x15c/0x4b4 [mv643xx_eth]
[C3E01DC0] [D22820C0] mv643xx_eth_open+0x68/0xb0 [mv643xx_eth]
[C3E01DE0] [C025638C] dev_open+0x70/0xd8
[C3E01E00] [C02544F8] dev_change_flags+0x6c/0x13c
[C3E01E20] [C02A1838] devinet_ioctl+0x280/0x708
[C3E01E80] [C02A21BC] inet_ioctl+0xb4/0x100
[C3E01E90] [C02BF1A0] packet_ioctl+0x15c/0x188
[C3E01EB0] [C024A9A8] sock_ioctl+0x30c/0x334
[C3E01ED0] [C0093350] do_ioctl+0x3c/0x88
[C3E01EE0] [C0093784] vfs_ioctl+0x3e8/0x424
[C3E01F10] [C0093828] sys_ioctl+0x68/0x98
[C3E01F40] [C0010A60] ret_from_syscall+0x0/0x4c
--- Exception: c01 at 0x7f666e8
LR = 0x7f66680
eth1: no IPv6 routers present
--
short story of a lazy sysadmin:
alias appserv=wotan
^ permalink raw reply
* Re: [PATCH 8/8] Add support for Xilinx ML403 reference design
From: Grant Likely @ 2006-01-03 8:30 UTC (permalink / raw)
To: Paula Saameño; +Cc: linuxppc-embedded
In-Reply-To: <259581790601030029j6fa915f9nfb3869ad41915aa4@mail.gmail.com>
Paula Saameño wrote:
> Hi Grant,
>
> I´ll try the patches today and I let you know how is going.
BTW, 'make ml403_defconfig' should work
>
> See you!
>
> On 1/3/06, *Grant Likely* <grant.likely@secretlab.ca
> <mailto:grant.likely@secretlab.ca>> wrote:
>
> Paula Saameño wrote:
> > I am working with ML403 as well. Right now, I am using a 2.4.26
> kernel,
> > but I would be interested in a 2.6 one, it would be great!!
> >
> > Happy 2006!!
> > Paula Saameno
>
> Thanks Paula.
>
> Can you try the posted patches on your ML403? It should compile and
> boot with no problems with the reference design. (However, I got the
> memory size initialization wrong; add mem=64M to the kernel command
> line)
>
> I'll send a patch to fix the mem size tomorrow.
>
> Thanks,
> g.
>
> >
> > Florian wrote:
> >>> I don't have a public git tree at the moment for the xilinx virtex
> >>> stuff. I can certainly create and maintain one if there is
> demand. I
> >>> guess it depends on how many people want to colaborate on V2Pro/V4
> >>> support. Anyone else interested?
> >>
> >>
> >> Yes. I am also working on a Virtex-4 system with Linux.
> >> Do you support also a Linux 2.4 tree?
> > Sorry, no. I'm focusing on the 2.6 stuff. IIRC, the Denx tree is
> > tracking the virtex support in 2.4.
> >
> > Are you strictly working on 2.4? Or are you interested in 2.6 as
> well?
> >
> > Cheers,
> > g.
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org <mailto:Linuxppc-embedded@ozlabs.org>
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
> --
> Grant Likely, B.Sc. P.Eng.
> Secret Lab Technologies Ltd.
> (403) 663-0761
>
>
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox