LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: eldk bug?how to fix
From: Wolfgang Denk @ 2005-12-30 21:13 UTC (permalink / raw)
  To: Theo Gjaltema; +Cc: linuxppc-embedded
In-Reply-To: <43B459C5.1060206@chello.nl>

In message <43B459C5.1060206@chello.nl> you wrote:
>
> I've seen these messages before. They were gone when I compiled using
> ppc_8xx-gcc compiler of a different ELDK version.
> What version of ELDK are you using? Which gcc version?

This has nothing to do with ELDK versions,  or  any  other  toolchain
issues.

> >[root@localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c         
> >atm_aalx.c: In function `main':                                   
> >atm_aalx.c:201: warning: return type of `main' is not `int'       
> >/tmp/cciJlehe.s: Assembler messages:                              
> >/tmp/cciJlehe.s:916: Error: unsupported relocation against r3     
...
> >         mfmsr r3                  
> >         ori r3,r3,0x8000          
> >         andi. r3,r3,0xffbf        
> >         mtmsr r3                  

It's a user only problem (using symbolic names like  "r3"  in  inline
assember  statements  without  incuding  the  proper  header files to
resolve thise names).

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
We fight only when there is no other choice. We prefer  the  ways  of
peaceful contact.
	-- Kirk, "Spectre of the Gun", stardate 4385.3

^ permalink raw reply

* Re: Regarding booting 440 gr board / ibm emac driver
From: Wolfgang Denk @ 2005-12-30 21:17 UTC (permalink / raw)
  To: Kiran Kumar.A; +Cc: linuxppc-embedded
In-Reply-To: <20051230112111.58191CA092@ws7-4.us4.outblaze.com>

In message <20051230112111.58191CA092@ws7-4.us4.outblaze.com> you wrote:
>
> This is kiran here. I'm working on 440GR (Yosemite) board to boot linux-2.6
> .13.4.

Don't use old code. Please use the current version.

> What could be the issue? Do we need to modify the driver for MAC address is
> sue??

Just use current code. You can find ready to  run  binaries  and  the
corresponding sources (git repository) on our server:

ftp://ftp.denx.de/pub/u-boot/images/amcc/yosemite/u-boot.bin
ftp://ftp.denx.de/pub/linux/images/amcc/yosemite/uImage
and http://www.denx.de/cgi-bin/gitweb.cgi?p=linux-2.6-denx.git
(git tag "DENX-2005-12-03-2208" or later).

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
A Puritan is someone who is deathly afraid that  someone,  somewhere,
is having fun.

^ permalink raw reply

* Re: [PATCH 8/8] Add support for Xilinx ML403 reference design
From: Grant Likely @ 2005-12-31  3:58 UTC (permalink / raw)
  To: David H. Lynch Jr., linuxppc-embedded
In-Reply-To: <43B5E37A.4020008@dlasys.net>

David H. Lynch Jr. wrote:
> 	I am working on a port of 2.6.14.5 to the Pico E-12 which is a Xilinx
> Virtex-IV system in a CF card. It is very similar to the ML403 but with
> alot less hardware. I would love to be able to pull a whole tree of the
> stuff you are working on - is there a git, svn, or cvs tree that the
> linuxppc-embedded patches are getting merged into ? and How can it be
> accessed ?
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?

> 	Right now I am trying to get /init to run - actually it runs but I am
> not getting IO on the console. Anyway, I hope to put out a collection of
> patches when I have it really working. Aside from the Pico  e-12 itself,
> I have Uartlite drivers that are consistent with the way the rest of the
> 2.6 serial drivers are layed out as well as a custom serial driver
> specific to the E-12. The E-12 stuff might not make it into the
> distribution kernel, but I would think there might be some interest in
> the UartLite driver.
Since the E-12 is a commercially available board, it would be useful to
have the patches on the ML, even if they don't get applied to mainline.

> 
> 	Anyway it would be nice to work against whatever all the
> linuxppc-embedded patches are going into.
I'm working off the mainline linux-2.6 tree from kernel.org.  PPC
patches are getting merged into mainline frequently.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761

^ permalink raw reply

* Re: Howto submit drivers/patches ?
From: Grant Likely @ 2005-12-31  4:02 UTC (permalink / raw)
  To: David H. Lynch Jr.; +Cc: linuxppc-embedded
In-Reply-To: <43A64446.8080109@comcast.net>

David H. Lynch Jr. wrote:
> 	I am just polishing off bringup a Xilinx Virtex IV/ppc405 system with
> minimal hardware under 2.6.14.4.
> 	I have a collection of patches that I can submit for the specific,
> board, for the Virtex IV, for board specific hardware, ...
> 	Additionally I have 2 complete boot loader through full serial driver
> implementations of a pseudo serial console driver for this board when it
> is in a HOST development system - it is a compact flash card normally
> plugged into a PC during development and using the PC as the console,
> and a complete serial driver chain for the Xilinx UartLite as a console
> when not in a Host, or as a general serial driver. The Xilinx Driver is
> based heavily on other 2.6 driver/serial drivers and not the 2.4
> implementation from Xilinx.
> 
> 	Is this list the right place to submit this ?
> 	Is there a HOWTO addressing the rules/procedures to do so.
Do you want to send me your patches for the UartLite (and cc the list)?
 I'd be happy to take a look.  What other things did you change?

g.


-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761

^ permalink raw reply

* tftp
From: bharathi kandimalla @ 2005-12-31  7:12 UTC (permalink / raw)
  To: linuxppc-embedded

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

Hi
     I am working on the MPC860T .I am able to port the linux2.6  on to the board.I got prompt. eventhough I have enabled the tftp   I am not able to get the files  using tftp
  from the host machine
  fconfig
eth0      Link encap:Ethernet  HWaddr 9A:52:63:15:85:25
          inet addr:192.168.3.2  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:512 (512.0 B)  TX bytes:0 (0.0 B)
          Base address:0xe00
  lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
   
  [root@(none) ~]# tftp
-sh: tftp: command not found
   
  please help me out
  regards
  bharathi  
   
   

		
---------------------------------
 Yahoo! DSL Something to write home about. Just $16.99/mo. or less

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

^ permalink raw reply

* Re: tftp
From: Wolfgang Denk @ 2005-12-31 10:35 UTC (permalink / raw)
  To: bharathi kandimalla; +Cc: linuxppc-embedded
In-Reply-To: <20051231071231.54555.qmail@web50008.mail.yahoo.com>

In message <20051231071231.54555.qmail@web50008.mail.yahoo.com> you wrote:
>
>      I am working on the MPC860T .I am able to port the linux2.6  on to the board.I got prompt. eventhough I have enabled the tftp   I am not able to get the files  using tftp
>   from the host machine
...
>   [root@(none) ~]# tftp
> -sh: tftp: command not found

"command not found" - this is a pretty clear error message. Try
installing the tftp command on your target system ...

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
An optimist believes we live in the best world possible; a  pessimist
fears this is true.

^ permalink raw reply

* Re: Migrate vxworks bsp to linux
From: Esben Nielsen @ 2005-12-31 10:55 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: siman, linuxppc-embedded
In-Reply-To: <20051230081049.2C117352ADF@atlas.denx.de>

On Fri, 30 Dec 2005, Wolfgang Denk wrote:

> In message <001301c60ce8$7b4456a0$1200a8c0@xbh> you wrote:
> >
> > I have the prpmc610 borad(with MPC8245), I have the board's vxworks bsp, did
> > anybody have experience to migrate  from the vxworks to Linux system? I
> > think the main problem is initial the boards.
>
> You start porting a boot loader, like U-Boot.

To see if I could get Linux to run on our MPC5200 board I politely asked
the vxWorks bootloader to boot the Linux kernel via ftp. It worked. I used
the Denx kernel for the Lite5200. I had to compile the kernel with good
default parameters (ip address, nfsroot, serial setup etc.) as I couldn't
make the  vxWorks bootsector parse kernel parameters. It was a good and
very easy way to demonstrate that Linux could run on our board.

Esben

>
> 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
> As far as the laws of mathematics refer  to  reality,  they  are  not
> certain;  and  as  far  as  they  are  certain,  they do not refer to
> reality.                                           -- Albert Einstein
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

^ permalink raw reply

* Re: Regarding booting 440 gr board / ibm emac driver
From: Stefan Roese @ 2005-12-31 12:14 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Kiran Kumar.A
In-Reply-To: <20051230211710.72899352597@atlas.denx.de>

On Friday 30 December 2005 22:17, Wolfgang Denk wrote:
> In message <20051230112111.58191CA092@ws7-4.us4.outblaze.com> you wrote:
> > This is kiran here. I'm working on 440GR (Yosemite) board to boot
> > linux-2.6 .13.4.
>
> Don't use old code. Please use the current version.
>
> > What could be the issue? Do we need to modify the driver for MAC address
> > is sue??
>
> Just use current code. You can find ready to  run  binaries  and  the
> corresponding sources (git repository) on our server:
>
> ftp://ftp.denx.de/pub/u-boot/images/amcc/yosemite/u-boot.bin
> ftp://ftp.denx.de/pub/linux/images/amcc/yosemite/uImage
> and http://www.denx.de/cgi-bin/gitweb.cgi?p=linux-2.6-denx.git
> (git tag "DENX-2005-12-03-2208" or later).

Just a quick note, since you mentioned using 440GR (Yosemite): Yosemite is the 
eval board for the 440EP and Yellowstone is the eval board for the 440GR. 
Images for both boards are available at the site referenced by Wolfgang.

Best regards,
Stefan

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2005-12-31 23:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
	linux-input
In-Reply-To: <200512252304.32830.dtor_core@ameritech.net>

On Sun, Dec 25, 2005 at 11:04:30PM -0500, Dmitry Torokhov wrote:
> Well, we have used 11 out of 32 available bits so there still some
> reserves. My concern is that your implementation allows only one
> hook to be installed while with quirks you can have several of them
> active per device.

Below you find an implementation using quirks:

---
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	2005-12-31 22:39:53.000000000 +0100
@@ -1580,6 +1580,10 @@ 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, 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 },
+
 	{ 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	2005-12-31 23:49:42.000000000 +0100
@@ -63,6 +63,66 @@ 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 input_pb_translation {
+	u16 from;
+	u16 to;
+	u8 flags;
+};
+
+#define POWERBOOK_FLAG_FKEY 0x01
+
+static struct input_pb_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 input_pb_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_ENTER,	KEY_KPENTER },
+	{ }
+};
+
+static int powerbook_fkeysfirst = 1;
+module_param_named(pb_fkeysfirst, powerbook_fkeysfirst, bool, 0644);
+MODULE_PARM_DESC(powerbook_fkeysfirst, "Use fn special keys only while pressing fn");
+
+static int powerbook_enablefnkeys = 1;
+module_param_named(pb_enablefnkeys, powerbook_enablefnkeys, bool, 0644);
+MODULE_PARM_DESC(powerbook_enablefnkeys, "Enable fn special keys");
+
+static int powerbook_enablekeypad = 1;
+module_param_named(pb_enablekeypad, powerbook_enablekeypad, bool, 0644);
+MODULE_PARM_DESC(powerbook_enablekeypad, "Enable keypad keys");
+
 #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 +133,17 @@ 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 input_pb_translation *find_translation(
+	struct input_pb_translation *table, int from)
+{
+	struct input_pb_translation *trans;
+
+	/* Look for the translation */
+	for(trans = table; trans->from && !(trans->from == from); trans++);
+
+	return (trans->from?trans:NULL);
+}
+
 static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
 				     struct hid_usage *usage)
 {
@@ -94,7 +165,7 @@ static void hidinput_configure_usage(str
 
 	switch (usage->hid & HID_USAGE_PAGE) {
 
-		case HID_UP_UNDEFINED:
+	case HID_UP_UNDEFINED:
 			goto ignore;
 
 		case HID_UP_KEYBOARD:
@@ -325,7 +396,25 @@ 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;
+				/* The fn key on Apple PowerBooks */
+				case 0x0003: {
+					struct input_pb_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;
+				}
+
 				default:    goto ignore;
 			}
 			break;
@@ -482,6 +571,49 @@ void hidinput_hid_event(struct hid_devic
 		return;
 	}
 
+	if (hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) {
+		struct input_pb_translation *trans;
+
+		switch(usage->code) {
+		case 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;
+		}
+
+		if (powerbook_enablefnkeys) {
+			trans = find_translation(powerbook_fn_keys, usage->code);
+
+			if (trans) {
+				int known_key;
+
+				if (trans->flags & POWERBOOK_FLAG_FKEY)
+					known_key =
+						( powerbook_fkeysfirst &&  (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+						(!powerbook_fkeysfirst && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
+				else
+					known_key = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
+
+				if (known_key) {
+					input_event(input, usage->type, trans->to, value);
+					return;
+				}
+			}
+		}
+
+		if (powerbook_enablekeypad && test_bit(LED_NUML, input->led)) {
+			trans = find_translation(powerbook_numlock_keys, usage->code);
+
+			if (trans)
+				input_event(input, usage->type, trans->to, 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	2005-12-31 22:39:49.000000000 +0100
@@ -246,6 +246,9 @@ 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		0x0000800
+#define HID_QUIRK_POWERBOOK_FN_ON		0x0001000
+#define HID_QUIRK_POWERBOOK_NUMLOCK_ON		0x0002000
 
 /*
  * This is the global environment of the parser. This information is

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-01  1:33 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-kernel, linux-kernel, linuxppc-dev, Vojtech Pavlik,
	linux-input
In-Reply-To: <20051231235124.GA18506@hansmi.ch>

On Sun, Jan 01, 2006 at 12:51:24AM +0100, Michael Hanselmann wrote:
> +#define HID_QUIRK_POWERBOOK_NUMLOCK_ON		0x0002000

Aww, please ignore that one when looking at the patch. It's not used and
I'll resubmit the patch anyway with a full Signed-off-by & Co. once you
approve it.

Greets,
Michael

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Benjamin Herrenschmidt @ 2006-01-01  2:56 UTC (permalink / raw)
  To: Michael Hanselmann
  Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
	Vojtech Pavlik, linux-input
In-Reply-To: <20051231235124.GA18506@hansmi.ch>

On Sun, 2006-01-01 at 00:51 +0100, Michael Hanselmann wrote:
> On Sun, Dec 25, 2005 at 11:04:30PM -0500, Dmitry Torokhov wrote:
> > Well, we have used 11 out of 32 available bits so there still some
> > reserves. My concern is that your implementation allows only one
> > hook to be installed while with quirks you can have several of them
> > active per device.
> 
> Below you find an implementation using quirks:

I've been using the other patch for some time now and while it's a
life-saver, it does have one annoying little issue: If you press a key
with the Fn key down and release that key with the Fn key up, your key
is stuck. That is, the patch changes the keycode for Up & Down events
separately based on the Fn state at the time of the event.

What should be done is that when you release a key, you send the key up
with the keycode that matches the Fn state at the time the key was
pressed. That can easily be done using a simple bitmap that keeps track
of the Fn state on keydown for the various keycodes.

Ben.
  

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-01  3:03 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
	Vojtech Pavlik, linux-input
In-Reply-To: <1136084207.4635.86.camel@localhost.localdomain>

On Sun, Jan 01, 2006 at 01:56:47PM +1100, Benjamin Herrenschmidt wrote:
> I've been using the other patch for some time now and while it's a
> life-saver, it does have one annoying little issue: If you press a key
> with the Fn key down and release that key with the Fn key up, your key
> is stuck.

I noticed something like that with the numlock key as well but didn't
have time to fix it yet.

Other than that, have you found any keys that aren't mapped or are
mapped incorrectly?

The new patch adds quite some code to hid-input.c, should it be
configuratible via .config?

Thanks,
Michael

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Benjamin Herrenschmidt @ 2006-01-01  6:09 UTC (permalink / raw)
  To: Michael Hanselmann
  Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
	Vojtech Pavlik, linux-input
In-Reply-To: <20060101030331.GA26559@hansmi.ch>

On Sun, 2006-01-01 at 04:03 +0100, Michael Hanselmann wrote:
> On Sun, Jan 01, 2006 at 01:56:47PM +1100, Benjamin Herrenschmidt wrote:
> > I've been using the other patch for some time now and while it's a
> > life-saver, it does have one annoying little issue: If you press a key
> > with the Fn key down and release that key with the Fn key up, your key
> > is stuck.
> 
> I noticed something like that with the numlock key as well but didn't
> have time to fix it yet.
> 
> Other than that, have you found any keys that aren't mapped or are
> mapped incorrectly?

I haven't but then I haven't tested in depth neither. Such little bugs
if any can always be fixed later anyway.

> The new patch adds quite some code to hid-input.c, should it be
> configuratible via .config?

Possibly yes, since it's only useful for mac laptops...

Ben.

^ permalink raw reply

* Re: [PATCH 8/8] Add support for Xilinx ML403 reference design
From: Grant Likely @ 2006-01-02  8:00 UTC (permalink / raw)
  To: Florian
In-Reply-To: <43B8DAB3.2010001@ozlabs.org>

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.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761

^ permalink raw reply

* Re: [PATCH 8/8] Add support for Xilinx ML403 reference design
From: David H. Lynch Jr. @ 2005-12-31 16:34 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <43B601CC.1000102@secretlab.ca>

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

> 
> Since the E-12 is a commercially available board, it would be useful to
> have the patches on the ML, even if they don't get applied to mainline.

	So at what state should things be at before posting them ?

	Right now:
		The basic E-12 stuff is complete - though it couls use some polish. It
was based on the ML300 code, and almost certainly overlaps and conflicts
with your ML403 work. I would be happy to reconcile them, but I would
need to know what to work against.

		I am not a git expert at this point. I am working against the 2.6.14.5
source3 on kernel.org. There are numerous git trees what is the right one ?

	
		The serial/console drivers for the "Keyhole" - a bidirectional link
between a Linux/Windows development host and the E-12, and the Xilinx
UartLite are in (hopefully) late debugging, Output is probably complete,
UartLite input needs testing, Keyhole input needs alot of work - among
other things the host side is still only a display, so it is somewhat
difficult to do the Linux input side.

^ permalink raw reply

* Cross Compiling driver for PPC
From: venkatajagadeesh p @ 2006-01-02 11:52 UTC (permalink / raw)
  To: linuxppc-embedded

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

 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
 

		
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

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

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Stelian Pop @ 2006-01-02 12:06 UTC (permalink / raw)
  To: Michael Hanselmann
  Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
	Vojtech Pavlik, linux-input
In-Reply-To: <20051231235124.GA18506@hansmi.ch>

Le dimanche 01 janvier 2006 à 00:51 +0100, Michael Hanselmann a écrit :
> On Sun, Dec 25, 2005 at 11:04:30PM -0500, Dmitry Torokhov wrote:
> > Well, we have used 11 out of 32 available bits so there still some
> > reserves. My concern is that your implementation allows only one
> > hook to be installed while with quirks you can have several of them
> > active per device.
> 
> Below you find an implementation using quirks:
> 
> ---
> 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	2005-12-31 22:39:53.000000000 +0100
> @@ -1580,6 +1580,10 @@ 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, 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 },
> +

Works fine for me on a slightly older (jul '05) Powerbook after adding
the following USB identifiers:

+       { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
+       { USB_VENDOR_ID_APPLE, 0x020F, 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 },

Mine is a 020F but the other three ones should be fine too (those are
taken from the appletouch trackpad driver).

Stelian.
-- 
Stelian Pop <stelian@popies.net>

^ permalink raw reply

* Re: [PATCH] powerpc: Remove device_node addrs/n_addr
From: Olaf Hering @ 2006-01-02 13:15 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <1134457283.6989.185.camel@gaston>

 On Tue, Dec 13, Benjamin Herrenschmidt wrote:

> The pre-parsed addrs/n_addrs fields in struct device_node are finally
> gone. Remove the dodgy heuristics that did that parsing at boot and
> remove the fields themselves since we now have a good replacement with
> the new OF parsing code. This patch also fixes a bunch of drivers to use
> the new code instead, so that at least pmac32, pseries, iseries and g5
> defconfigs build.

> +++ linux-work/include/asm-powerpc/prom.h	2005-12-13 17:51:20.000000000 +1100

> @@ -120,8 +82,6 @@ struct device_node {
>  	char	*type;
>  	phandle	node;
>  	phandle linux_phandle;
> -	int	n_addrs;
> -	struct	address_range *addrs;
>  	int	n_intrs;
>  	struct	interrupt_info *intrs;
>  	char	*full_name;

Is this patch supposed to be complete? I will find references to n_addrs
in arch/powerpc:

hydra_init, chrp_find_bridges, chrp_find_openpic, comment in
of_finish_dynamic_node.

-- 
short story of a lazy sysadmin:
 alias appserv=wotan

^ permalink raw reply

* ELDK 4.0
From: HappyPhot @ 2006-01-02 14:29 UTC (permalink / raw)
  To: linuxppc-embedded

Dear group,
  Can anybody tell how to get ELDK 4.0 ?
I seems need to go to somewhere to get the 
source code to compile, right? Could you give
me a way ?

thank you,
/HappyPhot

^ permalink raw reply

* VFS: Cannot open root device "31:03" or unknown-block(31,3)
From: HappyPhot @ 2006-01-02 14:48 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,
  I've suffered for many days and "google" almost every where.
I would like to boot from the flash with jffs2 (i.e. using jffs2 as my
root /) . But it alyaws shows:
VFS: Cannot open root device..... (whole message is as below)

  Anybody knows what may cause this ? Please help and
thank you.

/HappyPhot

==============(booting message)==================
.......
physmap flash device: 1000000 at 70000000
phys_mapped_flash: Found 2 x8 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
5 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 5 MTD partitions on "phys_mapped_flash":
0x00000000-0x00200000 : "k4"
mtd: Giving out device 0 to k4
0x00200000-0x00400000 : "k6"
mtd: Giving out device 1 to k6
0x00400000-0x00800000 : "rd"
mtd: Giving out device 2 to rd
0x00800000-0x00c00000 : "jffs2"
mtd: Giving out device 3 to jffs2
0x00c00000-0x02000000 : "others"
mtd: Giving out device 4 to others
VFS: Cannot open root device "31:03" or unknown-block(31,3)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on 
unknown-block(31,3)
 <0>Rebooting in 180 seconds..
========================================== 

^ permalink raw reply

* Re: VFS: Cannot open root device "31:03" or unknown-block(31,3)
From: David Jander @ 2006-01-02 15:57 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: HappyPhot
In-Reply-To: <000701c60fab$9fdca6a0$0760120a@photon>

On Monday 02 January 2006 15:48, HappyPhot wrote:
> Hi,
>   I've suffered for many days and "google" almost every where.
> I would like to boot from the flash with jffs2 (i.e. using jffs2 as my
> root /) . But it alyaws shows:
> VFS: Cannot open root device..... (whole message is as below)
>
>   Anybody knows what may cause this ? Please help and
> thank you.
>[...]

You omitted the interesting part of the log output, the bootarguments at the 
very beginning. What is the value of root= ?
Maybe you made the typical mistake of specifying /dev/mtd3 instead 
of /dev/mtdblock3, or you didn't compile in support for mtd access as a block 
device?

Greetings,

-- 
David Jander

^ permalink raw reply

* Re: [PATCH 8/8] Add support for Xilinx ML403 reference design
From: Grant Likely @ 2006-01-02 16:26 UTC (permalink / raw)
  To: David H. Lynch Jr.; +Cc: linuxppc-embedded
In-Reply-To: <43B6B32A.5060606@dlasys.net>

David H. Lynch Jr. wrote:
> Grant Likely wrote:
> 
>>David H. Lynch Jr. wrote:
> 
> 
>>Since the E-12 is a commercially available board, it would be useful to
>>have the patches on the ML, even if they don't get applied to mainline.
> 
> 
> 	So at what state should things be at before posting them ?
> 
> 	Right now:
> 		The basic E-12 stuff is complete - though it couls use some polish. It
> was based on the ML300 code, and almost certainly overlaps and conflicts
> with your ML403 work. I would be happy to reconcile them, but I would
> need to know what to work against.
If you want initial comments, then don't worry about polish; Send your
raw diff (in unified format please!) and put [RFC] in the subject line
so nobody mistakes it as stable code.  :)  I'll happily comment on it.

I'm sure it conflicts with my ML403 work considering I've moved from the
OCP to the platform bus.

> 
> 		I am not a git expert at this point. 
Neither am I.  :)

Try this:
install GIT:     http://linux.yyz.us/git-howto.html#installing_git
install Cogito:  http://www.kernel.org/pub/software/scm/cogito/README
easy user guide: http://wellington.pm.org/archive/200510/git/

> I am working against the 2.6.14.5
> source3 on kernel.org. There are numerous git trees what is the right one ?
I'm using Linus's tree, seeked to tag v2.6.14.

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

> 
> 	
> 		The serial/console drivers for the "Keyhole" - a bidirectional link
> between a Linux/Windows development host and the E-12, and the Xilinx
> UartLite are in (hopefully) late debugging, Output is probably complete,
> UartLite input needs testing, Keyhole input needs alot of work - among
> other things the host side is still only a display, so it is somewhat
> difficult to do the Linux input side.
> 


-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
(403) 663-0761

^ permalink raw reply

* Re: [PATCH] powerpc: Remove device_node addrs/n_addr
From: Benjamin Herrenschmidt @ 2006-01-02 22:01 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev list
In-Reply-To: <20060102131539.GA12434@suse.de>

On Mon, 2006-01-02 at 14:15 +0100, Olaf Hering wrote:
>  On Tue, Dec 13, Benjamin Herrenschmidt wrote:
> 
> > The pre-parsed addrs/n_addrs fields in struct device_node are finally
> > gone. Remove the dodgy heuristics that did that parsing at boot and
> > remove the fields themselves since we now have a good replacement with
> > the new OF parsing code. This patch also fixes a bunch of drivers to use
> > the new code instead, so that at least pmac32, pseries, iseries and g5
> > defconfigs build.
> 
> > +++ linux-work/include/asm-powerpc/prom.h	2005-12-13 17:51:20.000000000 +1100
> 
> > @@ -120,8 +82,6 @@ struct device_node {
> >  	char	*type;
> >  	phandle	node;
> >  	phandle linux_phandle;
> > -	int	n_addrs;
> > -	struct	address_range *addrs;
> >  	int	n_intrs;
> >  	struct	interrupt_info *intrs;
> >  	char	*full_name;
> 
> Is this patch supposed to be complete? I will find references to n_addrs
> in arch/powerpc:
> 
> hydra_init, chrp_find_bridges, chrp_find_openpic, comment in
> of_finish_dynamic_node.

No, it's complete as far as powermac is concerned. I'll deal with the
remaining bits this week.

Ben.

^ permalink raw reply

* Re: [PATCH/RFC?] usb/input: Add support for fn key on Apple PowerBooks
From: Michael Hanselmann @ 2006-01-02 22:46 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, Dmitry Torokhov, linux-kernel, linuxppc-dev,
	Vojtech Pavlik, linux-input
In-Reply-To: <1136084207.4635.86.camel@localhost.localdomain>

On Sun, Jan 01, 2006 at 01:56:47PM +1100, Benjamin Herrenschmidt wrote:
> I've been using the other patch for some time now and while it's a
> life-saver, it does have one annoying little issue: If you press a key
> with the Fn key down and release that key with the Fn key up, your key
> is stuck.

Here's another patch with this and some other issues fixed.

Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Acked-by: Rene Nussbaumer <linux-kernel@killerfox.forkbomb.ch>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

---
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-02 23:35:36.000000000 +0100
@@ -63,6 +63,70 @@ 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_ENTER,	KEY_KPENTER },
+	{ KEY_F6,	KEY_NUMLOCK },
+	{ }
+};
+
+static int powerbook_fkeysfirst = 1;
+module_param_named(pb_fkeysfirst, powerbook_fkeysfirst, bool, 0644);
+MODULE_PARM_DESC(powerbook_fkeysfirst, "Use fn special keys only while pressing fn");
+
+static int powerbook_enablefnkeys = 1;
+module_param_named(pb_enablefnkeys, powerbook_enablefnkeys, bool, 0644);
+MODULE_PARM_DESC(powerbook_enablefnkeys, "Enable fn special keys");
+
+static int powerbook_enablekeypad = 1;
+module_param_named(pb_enablekeypad, powerbook_enablekeypad, bool, 0644);
+MODULE_PARM_DESC(powerbook_enablekeypad, "Enable keypad keys");
+#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 +137,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, int 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 (powerbook_enablefnkeys) {
+		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 =
+					( powerbook_fkeysfirst &&  (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+					(!powerbook_fkeysfirst && !(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 (powerbook_enablekeypad) {
+		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 +468,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 +645,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-02 21:44:15.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		0x0000800
+#define HID_QUIRK_POWERBOOK_FN_ON		0x0001000
 
 /*
  * 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: VFS: Cannot open root device "31:03" or unknown-block(31,3)
From: HappyPhot @ 2006-01-03  2:48 UTC (permalink / raw)
  To: David Jander, linuxppc-embedded
In-Reply-To: <200601021657.35359.david.jander@protonic.nl>

> On Monday 02 January 2006 15:48, HappyPhot wrote:
>> Hi,
>>   I've suffered for many days and "google" almost every where.
>> I would like to boot from the flash with jffs2 (i.e. using jffs2 as my
>> root /) . But it alyaws shows:
>> VFS: Cannot open root device..... (whole message is as below)
>>
>>   Anybody knows what may cause this ? Please help and
>> thank you.
>>[...]
>
> You omitted the interesting part of the log output, the bootarguments at 
> the
> very beginning. What is the value of root= ?
> Maybe you made the typical mistake of specifying /dev/mtd3 instead
> of /dev/mtdblock3, or you didn't compile in support for mtd access as a 
> block
> device?
>

Hi, David and all,
  I've tried root=/dev/mtdblock3, root=/dev/mtd3, root=31:03 etc.  And 
"Caching
block device access to MTD devices" was also selected when 'make 
menuconfig'.
The results were the same.
  I use "phys_mapped_flash" and "mtdparts=phys_mapped_flash:2M(k4),2M(k6),
4M(rd),4M(jffs2),-(User_Data)". What is the "root=" I should use ?

  Also, I am wondering how the kernel knows "/dev/mtdblock3" is in my flash 
?
I think I never do any setting about this....

thank you ,
/HappyPhot

^ 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