[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Xilinux PS2 mouse driver
Hi !!!
I have a problem regarding the PS2 drivers from the which i got fron
Xilinx website
http://www.xilinx.com/products/boards/ml401/reference_designs.htm
in ML401 EDK Embedded MicroBlaze Reference Design zip file ,after unzipping in the path
projects/ml401_emb_ref/drivers/ps2_ref_v1_00_a/src$
this code id similar to the Xilinux Emac code,here they have a adapter.c file which has Xilinx Ethernet Adapter component to interface XEmac component to Linux.
Similarly i want to write a adapter.c for my PS2 mouse,can anyone suggest me how to write it.
when i mailed to the xilinux wedsite they asked me to get into this dicussion forum.
at present i have written this code.In the hyper terminal the output is "psmouse is mapped to the address 0xffff7000"
now can i initialize and write up the ISR routine
similar to pc_keyb.c in uClinux-dist/linux-2.4.x/drivers/char/pc_keyb.c
can i use the same functions in pc_keyb.c to initialize and for the ISR.
i am confused in this part...can anyone give me suggestions in this
following is the small bit of my adapter.c
static int __init
probe(int index)
{
static const unsigned long remap_size
= CONFIG_MOUSE_0_HIGHADDR - CONFIG_MOUSE_0_BASEADDR + 1;
struct xps2_instance *inst;
XPs2_Config *cfg;
/* Find the config for our instance. */
cfg = XPs2_GetConfig(index);
if (!cfg)
return -ENODEV;
/* Allocate the inst and zero it out. */
inst = (struct xps2_instance *) kmalloc(sizeof (struct xps2_instance),
GFP_KERNEL);
if (!inst) {
printk(KERN_ERR "%s #%d: Could not allocate instance.\n",
miscdev.name, index);
return -ENOMEM;
}
memset(inst, 0, sizeof (struct xps2_instance));
inst->index = index;
/* Make it the head of inst_list. */
inst->next_inst = inst_list;
inst_list = inst;
/* Change the addresses to be virtual; save the old ones to restore. */
inst->save_BaseAddress = cfg->BaseAddress;
cfg->BaseAddress = (u32) ioremap(inst->save_BaseAddress, remap_size);
/* Tell the Xilinx code to bring this MOUSE interface up. */
if (XPs2_Initialize(&inst->Ps2, cfg->DeviceId) != XST_SUCCESS) {
printk(KERN_ERR "%s #%d: Could not initialize instance.\n",
miscdev.name, inst->index);
remove_head_inst();
return -ENODEV;
}
printk(KERN_INFO "%s #%d at 0x%08X mapped to 0x%08X\n",
miscdev.name, inst->index,
inst->save_BaseAddress, cfg->BaseAddress);
return 0
}
Thanks & Regards
Hema
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/