Finding PCI device register values through KEXT and user App.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mBYkWCWwdvA4eNLkY+Ur6n4LLEI7Wshshdx8nIik5yG77mMM3L4fC7mvpPDBmgwQEIFyS7SF3g1mbP2K+jdYGxB7eWzet4JrwtUqRWk2w1BZYSZH3bQwX2deWBoaQyw0Rew8UYcRkkhWy1414D+OuxRaJAOpRcOOYQpBxaZK3BA= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=dhMaa15QmMkrWdL3NunlRnZ54hiQheqqsr53cVZwoaCFul5n9yk/LePcdKmwUqDkDPdjFb45Y+dn8kjL2LGqKtYbtJTgc/G8sqjupRlogXtl2MHWVEl2XABQPuoD27xv13gKpXDDlTK7Ou6chPQYQ6upLzahfkLMOfYAeSvS+AM= Dear all, I have developed a kernel extension module for a monitor calibration tool. The prime responsibilty of this module is to communicate to graphics card which in turn communicates to the monitor through i2c communication. Video graphics card have set of registers for i2c communication - data and clock. I need to communicate with a particular card, (ATI Rage 128 pro DVI) card but I do not have the base offsets and masking values for the same. So my query is to "how to find base offsets of i2c in a video graphics card ?" Below is one of the method I planned to find the i2c data and clock offsets and want your expert comments for the same. I would be thankful if you could please review this idea and if possible share some better alternate ideas /////////////////////////////// Step 1) MAP PCI DEVICE MEMORY Map the PCI device memory and get the virtual address and size of the address. /* code snippet */ fRegisterMap = fPCIDevice->mapDeviceMemoryWithRegister(uladdr); deviceRegisters = (ati_reg *)fRegisterMap->getVirtualAddress(); /********************/ Step 2) MAP MEMORY TO USER LEVEL APPLICATION To map i plan to use clientMemoryForType() in my kext /* code snippet */ fMemoryToShare->retain(); *memory = fMemoryToShare; /*********************/ Step 3) USER LEVEL APPLICATION PROCESS The user level application will open the driver and communicate with the driver and get the mapped memory region. See the memory region using Xcode debugger, it will print the address and memory location /* code snippet */ IOConnectMapMemory() // to get the mapped memory at use level /*****************/ Step 4) I2C COMMUNICATION THROUGH COMMANDS In the application use i2c api;s to read EDID data. This will write/read parameters from the graphics card for i2c communication with monitor by writting/reading at some registers on the graphics card. /*code for EDID can be taken from*/ http://darwinsource.opendarwin.org/Current/IOGraphics-179.2/tools/i2cexample... Step 4) Check the memory changes The address whose memory location changes will be the offset of the i2c for data/clock /////////////////////////////// Can you please comment if this approcah feasible and correct way to find offset in a video graphics card of a particular register ? Or there is any alternate methods for the same ? Any ideas? The main objective is to find the offset and masking values of i2c registers in a video graphics card, all suggestions are most welcome. Please comment Thanks and Regards, Rohit -- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
rohit dhamija