All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Thomas Leonard <talex5@gmail.com>, xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org, stefano.stabellini@eu.citrix.com,
	Dave.Scott@eu.citrix.com, anil@recoil.org
Subject: Re: [PATCH ARM v4 11/12] mini-os: get GIC addresses from FDT
Date: Wed, 18 Jun 2014 18:25:03 +0100	[thread overview]
Message-ID: <53A1CB6F.4050209@linaro.org> (raw)
In-Reply-To: <1403104106-32538-12-git-send-email-talex5@gmail.com>

Hi Thomas,

On 06/18/2014 04:08 PM, Thomas Leonard wrote:
>  //#define VGIC_DEBUG
>  #ifdef VGIC_DEBUG
> @@ -168,9 +169,38 @@ static void gic_handler(void) {
>  }
>  
>  void gic_init(void) {
> -    // FIXME Get from dt!
> -    gic.gicd_base = (char *)0x2c001000ULL;
> -    gic.gicc_base = (char *)0x2c002000ULL;
> +    gic.gicd_base = NULL;

Any reason to not fold this patch in patch #7? Or better move the gic
code in a separate patch?

This would avoid to hardcode a GIC address which is completely wrong
with Xen unstable.

> +    int node = 0;
> +    int depth = 0;
> +    for (;;)
> +    {
> +        node = fdt_next_node(device_tree, node, &depth);
> +        if (node <= 0 || depth < 0)
> +            break;
> +
> +        /*
> +           int name_len = 0;
> +           const char *name = fdt_get_name(device_tree, node, &name_len);
> +           printk("Found node: %d (%.*s)\n", node, name_len, name);
> +         */

This should be drop.

> +
> +        if (fdt_getprop(device_tree, node, "interrupt-controller", NULL)) {

You have to check the compatible string here.

> +            int len = 0;
> +            const uint64_t *reg = fdt_getprop(device_tree, node, "reg", &len);
> +            if (reg == NULL || len != 32) {

You made assumption of the layout of the device tree provided by Xen:
	- #address-cells == #size-cells == 2
	- regs contains a valid physical address, i.e the device is not under a bus

This can be changed by the toolstack in the future and will likely break
mini-os.

I would add a layer to support FDT address and interrupt translation
correctly. I'm not the maintainer of the mini-os, so I let them decide :).

I think, FreeBSD provides a good library for the translation (see
sys/dev/fdt/fdt_common.c).

I spent lots of time to play with device tree on Xen side, so I can help
you if you needed.

-- 
Julien Grall

  reply	other threads:[~2014-06-18 17:25 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 15:08 [PATCH ARM v4 00/12] mini-os: initial ARM support Thomas Leonard
2014-06-18 15:08 ` [PATCH ARM v4 01/12] mini-os: build fixes Thomas Leonard
2014-06-18 16:26   ` Ian Campbell
2014-06-18 17:41   ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 02/12] mini-os: fixed shutdown thread Thomas Leonard
2014-06-18 15:08 ` [PATCH ARM v4 03/12] mini-os: fixed format string error in unbind_evtchn Thomas Leonard
2014-06-18 16:28   ` Ian Campbell
2014-06-18 17:42   ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 04/12] mini-os: use unbind_evtchn in unbind_all_ports Thomas Leonard
2014-06-18 16:30   ` Ian Campbell
2014-06-18 17:44   ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 05/12] mini-os: made off_t type signed Thomas Leonard
2014-06-18 16:31   ` Ian Campbell
2014-06-18 17:44   ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 06/12] mini-os: switched initial C entry point to arch_init Thomas Leonard
2014-06-18 15:08 ` [PATCH ARM v4 07/12] mini-os: initial ARM support Thomas Leonard
2014-06-18 17:48   ` Samuel Thibault
2014-06-18 22:40   ` Julien Grall
2014-06-23 15:10     ` Thomas Leonard
2014-06-23 16:55       ` Julien Grall
2014-06-23 22:33         ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 08/12] mini-os: arm: show registers, stack and exception vector on fault Thomas Leonard
2014-06-18 15:08 ` [PATCH ARM v4 09/12] mini-os: import libfdt Thomas Leonard
2014-06-18 18:02   ` Samuel Thibault
2014-06-18 15:08 ` [PATCH ARM v4 10/12] mini-os: get RAM base and size from the FDT Thomas Leonard
2014-06-18 17:38   ` Julien Grall
2014-06-19  8:39     ` Thomas Leonard
2014-06-19 11:24       ` Julien Grall
2014-07-02 15:51         ` Ian Campbell
2014-06-18 15:08 ` [PATCH ARM v4 11/12] mini-os: get GIC addresses from FDT Thomas Leonard
2014-06-18 17:25   ` Julien Grall [this message]
2014-06-19  8:50     ` Thomas Leonard
2014-06-19 10:58       ` Julien Grall
2014-06-19 16:14         ` Thomas Leonard
2014-06-19 16:20           ` Julien Grall
2014-07-02 15:55       ` Ian Campbell
2014-06-18 15:08 ` [PATCH ARM v4 12/12] mini-os: added ARM grant table initialisation Thomas Leonard
2014-06-18 17:27   ` Julien Grall
2014-06-25 16:41     ` Thomas Leonard
2014-06-25 16:50       ` Ian Campbell
2014-06-18 18:05   ` Samuel Thibault

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=53A1CB6F.4050209@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Dave.Scott@eu.citrix.com \
    --cc=anil@recoil.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=talex5@gmail.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.