mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Feng Li <lifeng1519@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [Question] Reading hardware registers
Date: Sat, 30 May 2015 22:49:13 +0800	[thread overview]
Message-ID: <4DED2452-7055-413A-A31C-AA2D617459F2@gmail.com> (raw)

Hi experts,

I need your help. I have written a simple driver on  S3C6410 arm board. I define my resource.

static struct resource inkprinter_resources[] = {
  [0] = {
    .start    = S3C64XX_PA_INKPRINTER,
    .end    = S3C64XX_PA_INKPRINTER + S3C64XX_SZ_INKPRINTER,
    .flags    = IORESOURCE_MEM,
  },
  [1] = {
    .start    = IRQ_EINT(1),
    .end    = IRQ_EINT(1),
    .flags    = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
  }
};

I want to keep trigger the interrupt when it’s low level. But it doesn’t keep trigger when it’s low. It only calls interrupt routine once.
So I need  print out interrupt hardware registers values for debugging.

EINT0CON0 0x7F008900 R/W External Interrupt configuration Register 0 0x0
EINT0CON1 0x7F008904 R/W External Interrupt configuration Register 1 0x0
EINT0FLTCON0 0x7F008910 R/W External Interrupt Filter Control Register 0 0x0
EINT0FLTCON1 0x7F008914 R/W External Interrupt Filter Control Register 1 0x0
EINT0FLTCON2 0x7F008918 R/W External Interrupt Filter Control Register 2 0x0
EINTF0LTCON3 0x7F00891C R/W External Interrupt Filter Control Register 3 0x0

I know I’m wrong with using `readl(0x7F008900)`, it reads virtual address. Maybe I need map it to kernel virtual address firstly.

How could I read hardware address, instead of virtual address? If I need  map, which kernel function should I choose, ioremap/vmap...?

Millions of thanks.

Regards,
Alex Feng

                 reply	other threads:[~2015-05-30 14:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4DED2452-7055-413A-A31C-AA2D617459F2@gmail.com \
    --to=lifeng1519@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®