[i2c] AMBA magic numbers

Drasko Draskovic drasko.draskovic at gmail.com
Tue Aug 15 10:02:56 CEST 2006


Hi all.
In amba_register_device(), I can see:

               for (pid = 0, i = 0; i < 4; i++)
            pid |= (readl(tmp + 0xfe0 + 4 * i) & 255) << (i * 8);
        for (cid = 0, i = 0; i < 4; i++)
            cid |= (readl(tmp + 0xff0 + 4 * i) & 255) << (i * 8);

        iounmap(tmp);

        if (cid == 0xb105f00d)
            dev->periphid = pid;

Where are those numbers: 0xfe0, 0xff0 and 0xb105f00d coming from?

Also, in some core.c (for example - in mach-intergrator) I can see:

static struct amba_device rtc_device = {
    .dev        = {
        .bus_id    = "mb:15",
    },
    .res        = {
        .start    = INTEGRATOR_RTC_BASE,
        .end    = INTEGRATOR_RTC_BASE + SZ_4K - 1,
        .flags    = IORESOURCE_MEM,
    },
    .irq        = { IRQ_RTCINT, NO_IRQ },
    .periphid    = 0x00041030,
};

static struct amba_device uart0_device = {
    .dev        = {
        .bus_id    = "mb:16",
    },
    .res        = {
        .start    = INTEGRATOR_UART0_BASE,
        .end    = INTEGRATOR_UART0_BASE + SZ_4K - 1,
        .flags    = IORESOURCE_MEM,
    },
    .irq        = { IRQ_UARTINT0, NO_IRQ },
    .periphid    = 0x0041010,
};

static struct amba_device uart1_device = {
    .dev        = {
        .bus_id    = "mb:17",
    },
    .res        = {
        .start    = INTEGRATOR_UART1_BASE,
        .end    = INTEGRATOR_UART1_BASE + SZ_4K - 1,
        .flags    = IORESOURCE_MEM,
    },
    .irq        = { IRQ_UARTINT1, NO_IRQ },
    .periphid    = 0x0041010,
};

static struct amba_device kmi0_device = {
    .dev        = {
        .bus_id    = "mb:18",
    },
    .res        = {
        .start    = KMI0_BASE,
        .end    = KMI0_BASE + SZ_4K - 1,
        .flags    = IORESOURCE_MEM,
    },
    .irq        = { IRQ_KMIINT0, NO_IRQ },
    .periphid    = 0x00041050,
};

static struct amba_device kmi1_device = {
    .dev        = {
        .bus_id    = "mb:19",
    },
    .res        = {
        .start    = KMI1_BASE,
        .end    = KMI1_BASE + SZ_4K - 1,
        .flags    = IORESOURCE_MEM,
    },
    .irq        = { IRQ_KMIINT1, NO_IRQ },
    .periphid    = 0x00041050,
};

The question is: what is .periphid? Why UARTS are always given 0x0041010? I
need to implement my i2c_device as an amba_device - what number should I put
there? Where can I find a list of these numbers?

Final question: are .bus_id optional?  If not, what values can these take
(it's a bit confusing that there start with mb:15. And why mb anyway, why
not dev? For exaple - dev:00)

Best regards,

-- 
Drasko DRASKOVIC

Software Developer
Elsys-DESIGN
Belgrade, Serbia
Tel. +381.11.311.5252
Fax. +381.11.311.5251
www.elsys-design.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.lm-sensors.org/pipermail/i2c/attachments/20060815/9343056f/attachment.html 


More information about the i2c mailing list