Devicetree
 help / color / mirror / Atom feed
From: Stephen Neuendorffer <stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: RE: [PATCH 5/8] arch/x86: Add support for device tree code.
Date: Fri, 16 Jul 2010 11:42:53 -0700	[thread overview]
Message-ID: <a33ca228-cb2c-4044-bf63-c653642415a0@SG2EHSMHS005.ehs.local> (raw)
In-Reply-To: <AANLkTinPIY4N9Gv_J7Ief7Scd57c0KEY6WtHsvQTBrzb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>



> -----Original Message-----
> From: glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org [mailto:glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org] On Behalf Of Grant Likely
> Sent: Friday, July 16, 2010 11:40 AM
> To: Stephen Neuendorffer
> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> Subject: Re: [PATCH 5/8] arch/x86: Add support for device tree code.
> 
> On Fri, Jul 16, 2010 at 12:13 PM, Stephen Neuendorffer
> <stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org> wrote:
> > A few support device-tree related support functions that x86 didn't
> > have before.
> >
> > Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> >
> > ----
> >
> >  I have no idea if continuing to add these functions to every arch is
> > a good thing or whether they should (for instance) be weak symbols
> > with a generic definition.
> > ---
> >  arch/x86/include/asm/device.h |    6 ++++
> >  arch/x86/include/asm/irq.h    |    4 ++
> >  arch/x86/kernel/Makefile      |    1 +
> >  arch/x86/kernel/device_tree.c |   63 +++++++++++++++++++++++++++++++++++++++++
> >  drivers/of/platform.c         |    2 +
> >  include/linux/of_irq.h        |    1 +
> >  6 files changed, 77 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/x86/kernel/device_tree.c
> >
> > diff --git a/arch/x86/include/asm/device.h b/arch/x86/include/asm/device.h
> > index 029f230..01414f2 100644
> > --- a/arch/x86/include/asm/device.h
> > +++ b/arch/x86/include/asm/device.h
> > @@ -14,6 +14,12 @@ struct dma_map_ops *dma_ops;
> >  };
> >
> >  struct pdev_archdata {
> > +#ifdef CONFIG_OF
> > +       u64 dma_mask;
> > +#endif
> 
> This hunk (probably) isn't necessary anymore

Doesn't compile without it because the code in fdt.c initializes it.

> >  };
> >
> > +/* Don't override the default bus id behaviour */
> > +#define of_device_make_bus_id __of_device_make_bus_id
> > +
> >  #endif /* _ASM_X86_DEVICE_H */
> > diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
> > index 5458380..6c61992 100644
> > --- a/arch/x86/include/asm/irq.h
> > +++ b/arch/x86/include/asm/irq.h
> > @@ -10,6 +10,10 @@
> >  #include <asm/apicdef.h>
> >  #include <asm/irq_vectors.h>
> >
> > +#define NO_IRQ (-1)
> > +
> 
> no.  irq 0 means no irq, and all patches adding #define NO_IRQ to x86
> have been nacked.  (Basically, all architectures using -1 to mean no
> irq are considered broken.  ARM is one of the few (albeit large)
> holdouts.  I've got a patch kicking around to change microblaze to use
> 0 for no_irq too.

OK, bogon there..  The question is: how to get rid of it, since the generic of/irq.c
code references it?

> 
> > +#define irq_dispose_mapping(...)
> > +
> >  static inline int irq_canonicalize(int irq)
> >  {
> >        return ((irq == 2) ? 9 : irq);
> > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
> > index e77b220..a5c20e8 100644
> > --- a/arch/x86/kernel/Makefile
> > +++ b/arch/x86/kernel/Makefile
> > @@ -105,6 +105,7 @@ scx200-y                    += scx200_32.o
> >
> >  obj-$(CONFIG_OLPC)             += olpc.o
> >  obj-$(CONFIG_X86_MRST)         += mrst.o
> > +obj-$(CONFIG_OF)               += device_tree.o
> >
> >  microcode-y                            := microcode_core.o
> >  microcode-$(CONFIG_MICROCODE_INTEL)    += microcode_intel.o
> > diff --git a/arch/x86/kernel/device_tree.c b/arch/x86/kernel/device_tree.c
> > new file mode 100644
> > index 0000000..f6d27f6
> > --- /dev/null
> > +++ b/arch/x86/kernel/device_tree.c
> > @@ -0,0 +1,63 @@
> > +#undef DEBUG
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/string.h>
> > +#include <linux/pci_regs.h>
> > +#include <linux/module.h>
> > +#include <linux/ioport.h>
> > +#include <linux/etherdevice.h>
> > +#include <linux/of.h>
> > +#include <linux/of_device.h>
> > +#include <linux/of_platform.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> > +
> > +struct bus_type of_platform_bus_type = {
> > +       .uevent = of_device_uevent,
> > +};
> > +EXPORT_SYMBOL(of_platform_bus_type);
> > +
> > +static int __init of_bus_driver_init(void)
> > +{
> > +       return of_bus_type_init(&of_platform_bus_type, "of_platform");
> > +}
> > +postcore_initcall(of_bus_driver_init);
> 
> of_platform_bus_type is going away, and besides it is currently
> defined in common code.  You shouldn't need this in arch code.
> 
> > +
> > +/*
> > + * The list of OF IDs below is used for matching bus types in the
> > + * system whose devices are to be exposed as of_platform_devices.
> > + *
> > + * This is the default list valid for most platforms. This file provides
> > + * functions who can take an explicit list if necessary though
> > + *
> > + * The search is always performed recursively looking for children of
> > + * the provided device_node and recursively if such a children matches
> > + * a bus type in the list
> > + */
> > +
> > +const struct of_device_id of_default_bus_ids[] = {
> > +       { .type = "soc", },
> > +       { .compatible = "soc", },
> > +       { .compatible = "simple-bus", },
> > +       { .type = "plb5", },
> > +       { .type = "plb4", },
> > +       { .type = "opb", },
> > +       { .type = "simple", },
> > +       {},
> > +};
> > +
> > +/*
> > + * Interrupt remapper
> > + */
> > +
> > +struct device_node *of_irq_find_parent_by_phandle(phandle p)
> > +{
> > +       return of_find_node_by_phandle(p);
> > +}
> 
> IIRC, this hook shouldn't be necessary anymore either.
> 
> > +unsigned int irq_create_of_mapping(struct device_node *controller,
> > +                                  const u32 *intspec, unsigned int intsize)
> > +{
> > +       return intspec[0];
> > +}
> > +EXPORT_SYMBOL_GPL(irq_create_of_mapping);
> 
> return intspec[0] + 1;  ... at least until I've got proper
> cross-platform devicetree to virtual irq mapping code implemented.
> 
> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > index 125f2bc..3ec3147 100644
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -18,6 +18,8 @@
> >  #include <linux/slab.h>
> >  #include <linux/of_device.h>
> >  #include <linux/of_platform.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> >
> >  extern struct device_attribute of_platform_device_attrs[];
> >
> > diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
> > index 5929781..25fc90d 100644
> > --- a/include/linux/of_irq.h
> > +++ b/include/linux/of_irq.h
> > @@ -7,6 +7,7 @@ struct of_irq;
> >  #include <linux/errno.h>
> >  #include <linux/ioport.h>
> >  #include <linux/of.h>
> > +#include <linux/irq.h>
> >
> >  /*
> >  * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC
> > --
> > 1.5.6.6
> >
> >
> >
> > This email and any attachments are intended for the sole use of the named recipient(s) and
> contain(s) confidential information that may be proprietary, privileged or copyrighted under
> applicable law. If you are not the intended recipient, do not read, copy, or forward this email
> message or any attachments. Delete this email message and any attachments immediately.
> >
> >
> >
> 
> 
> 
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

  parent reply	other threads:[~2010-07-16 18:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1279304021-22216-1-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found] ` <1279304021-22216-1-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13   ` [PATCH 1/8] of/fdt.c: use architecture-independent ALIGN macro, defined in kernel.h Stephen Neuendorffer
     [not found]     ` <f2cebad3-5fb1-4984-800f-ef847e388e65-RaUQJvECHitZbvUCbuG1mrjjLBE8jN/0@public.gmane.org>
2010-07-16 18:29       ` Grant Likely
     [not found]         ` <AANLkTin8GUuMjAVI-r2KNXBoH7DjsQWfTjC1inQTlD6V-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 18:45           ` Stephen Neuendorffer
2010-07-19 18:34           ` Stephen Neuendorffer
     [not found] ` <1279304021-22216-2-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]   ` <1279304021-22216-2-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13     ` [PATCH 2/8] drivers/of: Make device tree code work on any arch Stephen Neuendorffer
     [not found]       ` <592c6c35-556d-4874-8b75-2ebf0acf00e9-+Ck8Kgl/v0+Da4789yZHSLjjLBE8jN/0@public.gmane.org>
2010-07-16 18:31         ` Grant Likely
     [not found]           ` <AANLkTimW3tsllx82F-cKtAEHGxVXwG4ESbtYWBzS17Wb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 18:34             ` Stephen Neuendorffer
     [not found]               ` <686f0008-74c9-4ee5-bfb3-b4920835b765-RaUQJvECHitEus+KprP3J7jjLBE8jN/0@public.gmane.org>
2010-07-16 18:55                 ` Grant Likely
     [not found]   ` <1279304021-22216-3-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]     ` <1279304021-22216-3-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13       ` [PATCH 3/8] of/fdt: Add unflatten_partial_device_tree Stephen Neuendorffer
     [not found]         ` <91a7e060-e748-47d5-aa7d-4fc45343d212-RaUQJvECHitEus+KprP3J7jjLBE8jN/0@public.gmane.org>
2010-07-16 19:25           ` Grant Likely
     [not found]             ` <AANLkTikbhjZshaetoTX6kXHwt_SobYUG69cuDZd0gArF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-23 22:10               ` Stephen Neuendorffer
     [not found]                 ` <58c8fb4d-50d9-45bb-9a09-9cd04033a912-RaUQJvECHiusiP+nND6G/7jjLBE8jN/0@public.gmane.org>
2010-08-10 17:53                   ` Grant Likely
     [not found]                     ` <AANLkTimE=YjDsr5em8ttAJkRzjZ6XMF_Hts0w0EpPzqx-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-17  0:44                       ` Stephen Neuendorffer
     [not found]                         ` <db162abd-e702-4d34-ac3a-ee6ce512f98d-+Ck8Kgl/v0/TR3wEnDZ30LjjLBE8jN/0@public.gmane.org>
2010-11-17  1:48                           ` Grant Likely
     [not found]     ` <1279304021-22216-4-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]       ` <1279304021-22216-4-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13         ` [PATCH 4/8] of/base.c: export property access/modification functions Stephen Neuendorffer
     [not found]           ` <01cb5edd-5330-40ba-b410-6732e44f0954-+Ck8Kgl/v0+Da4789yZHSLjjLBE8jN/0@public.gmane.org>
2010-07-16 18:33             ` Grant Likely
     [not found]               ` <AANLkTikwtfpH5qyG5cbsLYPHLSaAmBcHaSJT3zbt4s35-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 18:38                 ` Stephen Neuendorffer
     [not found]                   ` <e198df81-5939-4b82-9d27-952d9781ec05-+Ck8Kgl/v09CYczPSvLbDrjjLBE8jN/0@public.gmane.org>
2010-07-16 18:57                     ` Grant Likely
     [not found]                       ` <AANLkTilXmgTkJ2N0dTYsV99ElqssZAXwOgtKPBENZoX8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 20:07                         ` Stephen Neuendorffer
     [not found]                           ` <41b1b87c-a391-493d-8235-a9304562a6e4-RaUQJvECHis6W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-07-16 21:43                             ` Grant Likely
     [not found]                               ` <AANLkTinlTNa0TEnqk27Jv2Yy8sZ1Vx3V89YJvcs-jULM-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 22:03                                 ` Stephen Neuendorffer
     [not found]       ` <1279304021-22216-5-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]         ` <1279304021-22216-5-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13           ` [PATCH 5/8] arch/x86: Add support for device tree code Stephen Neuendorffer
     [not found]             ` <961e55b7-170c-45ac-a491-628797a0aa5e-+Ck8Kgl/v0/5op9OF0Koj7jjLBE8jN/0@public.gmane.org>
2010-07-16 18:39               ` Grant Likely
     [not found]                 ` <AANLkTinPIY4N9Gv_J7Ief7Scd57c0KEY6WtHsvQTBrzb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 18:42                   ` Stephen Neuendorffer [this message]
     [not found]                     ` <a33ca228-cb2c-4044-bf63-c653642415a0-RaUQJvECHitEus+KprP3J7jjLBE8jN/0@public.gmane.org>
2010-07-16 18:59                       ` Grant Likely
     [not found]                         ` <AANLkTinVIf2A_OVAXlqjHY5J3jvaraPlJySnyEKbhlqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 20:11                           ` Stephen Neuendorffer
     [not found]                             ` <a52173ec-5c74-47ce-9121-f2e90958b05d-RaUQJvECHiuJ1bAq5m18RLjjLBE8jN/0@public.gmane.org>
2010-07-16 20:28                               ` Grant Likely
     [not found]         ` <1279304021-22216-6-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]           ` <1279304021-22216-6-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13             ` [PATCH 6/8] [Xilinx] xilinx_pcipr: Added Xilinx reconfigurable PCI endpoint driver Stephen Neuendorffer
     [not found]               ` <19f2f30b-1b43-4729-a079-da1df0b04609-RaUQJvECHitZbvUCbuG1mrjjLBE8jN/0@public.gmane.org>
2010-07-16 18:43                 ` Grant Likely
     [not found]           ` <1279304021-22216-7-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]             ` <1279304021-22216-7-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13               ` [PATCH 7/8] [Xilinx] xilinx_hwicap: Update driver to use generic io accessors Stephen Neuendorffer
     [not found]             ` <1279304021-22216-8-git-send-email-stephen.neuendorffer@xilinx.com>
     [not found]               ` <1279304021-22216-8-git-send-email-stephen.neuendorffer-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2010-07-16 18:13                 ` [PATCH 8/8] [Xilinx] xilinx_hwicap: Enable whenever OF/device trees are available Stephen Neuendorffer
     [not found]                   ` <a10f704f-cc4b-4ca2-bd06-a9c4fa2853d4-+Ck8Kgl/v086W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-07-16 18:45                     ` Grant Likely
     [not found]                       ` <AANLkTilMVutoM9wH-67nqR2r3Lv-hq_aEKntjLk7_dgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-16 18:46                         ` Stephen Neuendorffer
2010-07-16 18:47                         ` Grant Likely
2010-07-22 16:05                         ` Grant Likely
     [not found]                           ` <AANLkTimm9hxxaj5ir2SynudRu1o4LKXnHy1AnJ1C_ii7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 18:25                             ` Stephen Neuendorffer

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=a33ca228-cb2c-4044-bf63-c653642415a0@SG2EHSMHS005.ehs.local \
    --to=stephen.neuendorffer-gjffaj9ahvfqt0dzr+alfa@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.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