linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Pieter <phenning@vastech.co.za>
To: linuxppc-dev@ozlabs.org
Subject: defining platform_devices in DTS
Date: Wed, 25 Feb 2009 11:20:52 +0200	[thread overview]
Message-ID: <49A50D74.50409@vastech.co.za> (raw)

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

Hi all

I am busy porting my board to Linux 2.6.27 from 2.6.19. The old Linux
was compiled using the ppc architecture, and had a "platform_device"
struct ure containing the custom devices on my board. (
/arch/ppc/platform/sdh8548.c and /arch/ppc/platform/sdh8548.h )

I assume these devices should now be declared in the device tree source.
Building the new Linux using the powerpc architecture, but I am
strugeling translating teh information defined in the "platform_device"
to a device tree node. In particular what happens to the resource.flags
could anyone help please?

Below is the "platform_device" definition and my interpretation of how
it should look in the device tree. Am I on the right track?
thanks pieter

platform_device definition:
  {
        .name = "bio",
        .id = 0,
        .dev.platform_data = NULL,
        .num_resources = 2,
        .resource = (struct resource[]) {
            {
                .start  = 0xe0100000,
                .end    = 0xe0100000 + 0x10000 -1,
                .flags  = IORESOURCE_MEM,    /* 0x00000200 */
            },
            {
                .name   = "int",
                .start  = MPC85xx_IRQ_EXT0,    /* 48 +
MPC85xx_OPENPIC_IRQ_OFFSET */
                .end    = MPC85xx_IRQ_EXT0,
                .flags  = IORESOURCE_IRQ,    /*0x00000400 */
            },
        },

FDT source:
    localbus@e0000000 {
        #address-cells = <2>;
        #size-cells = <1>;
        compatible = "simple-bus";
        reg = <0xe0000000 0x5000>;
        interrupt-parent = <&mpic>;

        ranges = <
            0x0 0x0 0xf8000000 0x07ffffff        /*128MB Flash*/
            0x1 0x0 0xe0200000 0x00200000        /*2MB FPGA*/
            0x2 0x0 0xe0100000 0x00100000         /*1MB BIO CPLD*/
        >;

        bio@2,0 {
            compatible = "wrs,epld-localbus";
            #address-cells = <2>;
            #size-cells = <1>;
            //interrupt-parent = <&mpic>;
            //interrupts = <48>;
            reg = <0x2 0x0 0x0010000>;
            ranges = <0x0 0x0 0x2 0x0 0x00100000>;
        };




[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 2722 bytes --]

             reply	other threads:[~2009-02-25  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25  9:20 Pieter [this message]
2009-02-26 15:57 ` defining platform_devices in DTS Grant Likely

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=49A50D74.50409@vastech.co.za \
    --to=phenning@vastech.co.za \
    --cc=linuxppc-dev@ozlabs.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).