kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Chan Kim" <ckim@etri.re.kr>
To: "'Greg KH'" <greg@kroah.com>
Cc: kernelnewbies@kernelnewbies.org,
	'qemu-discuss' <qemu-discuss@nongnu.org>
Subject: RE: Can't understand /proc/interrupts output for GICv3 case
Date: Mon, 11 Apr 2022 22:13:42 +0900	[thread overview]
Message-ID: <06cf01d84da5$f7a1fa80$e6e5ef80$@etri.re.kr> (raw)
In-Reply-To: <YlQj28enkHjZM2J5@kroah.com>

Hi, Greg K-H,
Thanks for replyaing.
> 
> You ask the system for it.  It depends on the bus type your driver is
> written for for how to do this.
> 
> For example, if you have a platform driver, you would call
> platform_get_irq().  If you are a pci driver, the irq for your device is
> already stored in the pci device structure passed into your probe
function.
> 
> What bus type is your driver written for?
> 
That sounds very logical. In my case I added it to system bus.
This is the qemu code making fdt. 

static void create_ab21q_axpu_device(const Ab21qMachineState *vms)
{
    char *nodename;
    printf("create_ab21q_axpu_device called!\n");
    hwaddr base = vms->memmap[AB21Q_AXPU].base;
    hwaddr size = vms->memmap[AB21Q_AXPU].size;
    int irq = vms->irqmap[AB21Q_AXPU];
    const char compat[] = "ab21q-axpu";

    sysbus_create_simple("ab21q-axpu", base, qdev_get_gpio_in(vms->gic,
irq));

    nodename = g_strdup_printf("/ab21q_axpu@%" PRIx64, base);
    qemu_fdt_add_subnode(vms->fdt, nodename);
    qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat,
sizeof(compat));
    qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", 2, base, 2,
size);
    qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts",
                           GIC_FDT_IRQ_TYPE_SPI, irq, 
                           GIC_FDT_IRQ_FLAGS_LEVEL_HI);
    qemu_fdt_setprop_cell(vms->fdt, nodename, "interrupt-parent",
vms->gic_phandle);

    g_free(nodename);
}

I understand it creates the device axpu and connects its irq output to a
gpio input connected to gic interrupt controller. 
But this driver is not in the form of platform device/driver. (a char
device). What function should I use to get the irq number in this case?
I couldn't find a function with a likely name in the tags file for linux
source.(5.4.188)

Thanks a lot!
Chan Kim





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2022-04-11 13:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  4:53 Can't understand /proc/interrupts output for GICv3 case Chan Kim
2022-04-11 12:36 ` Chan Kim
2022-04-11 12:49   ` Greg KH
2022-04-11 13:13     ` Chan Kim [this message]
2022-04-11 13:34       ` 'Greg KH'
2022-04-11 14:15         ` Chan Kim
2022-04-11 14:26           ` 'Greg KH'
2022-04-12  2:18             ` Chan Kim
2022-04-12  4:50               ` 'Greg KH'
2022-04-12  4:54                 ` Chan Kim
2022-04-12  6:51                   ` Chan Kim
2022-04-12 10:14                     ` 'Greg KH'
2022-04-11 14:32           ` Peter Maydell
2022-04-11 14:49             ` Greg KH
2022-04-11 14:58               ` Peter Maydell
2022-04-11 14:59               ` Ozgur Karatas
2022-04-11 14:53           ` Ozgur Karatas
2022-04-12  2:43             ` Chan Kim
2022-04-12  7:14               ` Ozgur Karatas
2022-04-12  7:22                 ` Chan Kim
2022-04-12  7:29                   ` Ozgur Karatas
2022-04-11 13:09   ` Ozgur Kara
2022-04-11 13:16     ` Chan Kim
2022-04-11 13:28       ` Ozgur Kara

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='06cf01d84da5$f7a1fa80$e6e5ef80$@etri.re.kr' \
    --to=ckim@etri.re.kr \
    --cc=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=qemu-discuss@nongnu.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).