kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: testlaster@gmail.com (testlaster)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Best way for PCI memory allocation?
Date: Thu, 18 Dec 2014 14:32:17 +0200	[thread overview]
Message-ID: <5492C951.60602@gmail.com> (raw)
In-Reply-To: <CAGwOe2ZUg9FA3ceUcw+xHBB0JGUztRO=+ONb5AturMBJwyPCaw@mail.gmail.com>

Hey Guys.
What would you say is the best memory allocation function to use when I 
want to dump a specific size and address of memory to a file?
Im working through the PCI chip to gain access to a shared 8meg memory 
bank. What I essentially have to do is try and access that bank from 
memory start to a specific memory offset and
dump all its containing data into a file as soon as possible.

This is a quick sum of my great adventures to try and get PCI device 
data and register offsets.
Im just summing this up so that you can see HOW I got to the PCI device 
info.

First I run __init pci_init_module()  and inside it the following.
-alloc_chrdev_region()
-MAJOR()
-pci_cdev_init();
-pci_register_driver();

Then it seems to me like the just automatically runs the .probe function 
and it runs these functions.
-pci_cdev-add()
-MKDEV();
-cdev_alloc();
cdev_init();
cdev->owner = THIS_MODULE;
-cdev_add();
dev_info();
pci_enabled_device();

Ok soo from here on I try and allocate / request regions of RAM.
This is what I tried :
pci_request_region();  and it failed miserably saying " BAR 3: Can't 
reserve [mem 0xe0800000 - 0xe0ffffff]
also
ioremap_nocache(pci_resource_start());  This works but it seems slow and 
I should copy register by register out of the ram? Is this the only way ?
also ive tried using
pci_set_dma_mask() ; which failed also with a return value of a really 
large value starting with 4.

I wanted to paste my code but the last time I pasted it my Email had to 
be moderated and they never came back to me about it :( .

  reply	other threads:[~2014-12-18 12:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  1:28 How to submit for eudyptula-challenge wangyubin
2014-03-25  1:52 ` Masood Mehmood
2014-12-18  6:02   ` sanjeev sharma
2014-12-18  6:55     ` Fernando Apesteguía
2014-12-18 12:32       ` testlaster [this message]
2014-12-18 15:24         ` Best way for PCI memory allocation? John de la Garza
2014-12-18 15:37           ` Nils Holland
2014-12-18  6:58     ` How to submit for eudyptula-challenge Manish Katiyar
2014-12-18  7:09     ` Sudip Mukherjee
2014-12-18 12:32       ` Vinícius Tinti
2014-12-18 12:37         ` Lucas Tanure
2014-12-18 16:22           ` Jessica Ross
2014-12-19  4:30             ` sanjeev sharma
2014-03-25  1:59 ` Parinay Kondekar
2014-03-25  2:16 ` Aruna Hewapathirane
2014-03-25  2:42   ` wangyubin
2014-03-25  2:48     ` Aruna Hewapathirane
2014-03-25  3:08       ` wangyubin
2014-03-25  3:28         ` Aruna Hewapathirane
2014-03-25  4:47           ` wangyubin
2014-03-25  5:29             ` Pranay Srivastava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5492C951.60602@gmail.com \
    --to=testlaster@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).