~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-spear3xx/spear3xx.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <asm/irq.h>
20
20
#include <asm/mach/arch.h>
21
21
#include <mach/generic.h>
22
 
#include <mach/spear.h>
 
22
#include <mach/hardware.h>
23
23
 
24
24
/* Add spear3xx machines common devices here */
25
25
/* gpio device registration */
35
35
        },
36
36
        .res = {
37
37
                .start = SPEAR3XX_ICM3_GPIO_BASE,
38
 
                .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1,
 
38
                .end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
39
39
                .flags = IORESOURCE_MEM,
40
40
        },
41
41
        .irq = {IRQ_BASIC_GPIO, NO_IRQ},
48
48
        },
49
49
        .res = {
50
50
                .start = SPEAR3XX_ICM1_UART_BASE,
51
 
                .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1,
 
51
                .end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
52
52
                .flags = IORESOURCE_MEM,
53
53
        },
54
54
        .irq = {IRQ_UART, NO_IRQ},
71
71
        {
72
72
                .virtual        = VA_SPEAR3XX_ICM1_UART_BASE,
73
73
                .pfn            = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
74
 
                .length         = SPEAR3XX_ICM1_UART_SIZE,
 
74
                .length         = SZ_4K,
75
75
                .type           = MT_DEVICE
76
76
        }, {
77
77
                .virtual        = VA_SPEAR3XX_ML1_VIC_BASE,
78
78
                .pfn            = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
79
 
                .length         = SPEAR3XX_ML1_VIC_SIZE,
 
79
                .length         = SZ_4K,
80
80
                .type           = MT_DEVICE
81
81
        }, {
82
82
                .virtual        = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
83
83
                .pfn            = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
84
 
                .length         = SPEAR3XX_ICM3_SYS_CTRL_SIZE,
 
84
                .length         = SZ_4K,
85
85
                .type           = MT_DEVICE
86
86
        }, {
87
87
                .virtual        = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
88
88
                .pfn            = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
89
 
                .length         = SPEAR3XX_ICM3_MISC_REG_SIZE,
 
89
                .length         = SZ_4K,
90
90
                .type           = MT_DEVICE
91
91
        },
92
92
};
523
523
        .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
524
524
        .enb_on_reset = 1,
525
525
};
526
 
 
527
 
#endif
528
 
 
529
 
/* spear padmux initialization function */
530
 
void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size)
 
526
#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
 
527
 
 
528
static void __init spear3xx_timer_init(void)
531
529
{
532
 
        int ret = 0;
533
 
 
534
 
        /* pad mux initialization */
535
 
        pmx_driver->base = ioremap(base, size);
536
 
        if (!pmx_driver->base) {
537
 
                ret = -ENOMEM;
538
 
                goto pmx_fail;
539
 
        }
540
 
 
541
 
        ret = pmx_register(pmx_driver);
542
 
        iounmap(pmx_driver->base);
543
 
 
544
 
pmx_fail:
545
 
        if (ret)
546
 
                printk(KERN_ERR "padmux: registration failed. err no: %d\n",
547
 
                                ret);
 
530
        char pclk_name[] = "pll3_48m_clk";
 
531
        struct clk *gpt_clk, *pclk;
 
532
 
 
533
        /* get the system timer clock */
 
534
        gpt_clk = clk_get_sys("gpt0", NULL);
 
535
        if (IS_ERR(gpt_clk)) {
 
536
                pr_err("%s:couldn't get clk for gpt\n", __func__);
 
537
                BUG();
 
538
        }
 
539
 
 
540
        /* get the suitable parent clock for timer*/
 
541
        pclk = clk_get(NULL, pclk_name);
 
542
        if (IS_ERR(pclk)) {
 
543
                pr_err("%s:couldn't get %s as parent for gpt\n",
 
544
                                __func__, pclk_name);
 
545
                BUG();
 
546
        }
 
547
 
 
548
        clk_set_parent(gpt_clk, pclk);
 
549
        clk_put(gpt_clk);
 
550
        clk_put(pclk);
 
551
 
 
552
        spear_setup_timer();
548
553
}
 
554
 
 
555
struct sys_timer spear3xx_timer = {
 
556
        .init = spear3xx_timer_init,
 
557
};