aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91/at91rm9200.c8
-rw-r--r--arch/arm/mach-at91/at91sam9260.c4
-rw-r--r--arch/arm/mach-at91/at91sam9261.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c2
-rw-r--r--arch/arm/mach-at91/at91x40.c7
-rw-r--r--arch/arm/mach-at91/clock.c30
-rw-r--r--arch/arm/mach-at91/cpuidle.c2
-rw-r--r--arch/arm/mach-at91/generic.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc.h3
-rw-r--r--arch/arm/mach-at91/irq.c9
-rw-r--r--arch/arm/mach-at91/pm.c2
-rw-r--r--arch/arm/mach-at91/setup.c2
-rw-r--r--arch/arm/mach-at91/soc.h1
15 files changed, 53 insertions, 27 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d193a409bc45..9eb574397ee1 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -332,10 +332,6 @@ static void __init at91rm9200_initialize(void)
332{ 332{
333 arm_pm_idle = at91rm9200_idle; 333 arm_pm_idle = at91rm9200_idle;
334 arm_pm_restart = at91rm9200_restart; 334 arm_pm_restart = at91rm9200_restart;
335 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
336 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
337 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
338 | (1 << AT91RM9200_ID_IRQ6);
339 335
340 /* Initialize GPIO subsystem */ 336 /* Initialize GPIO subsystem */
341 at91_gpio_init(at91rm9200_gpio, 337 at91_gpio_init(at91rm9200_gpio,
@@ -388,6 +384,10 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
388AT91_SOC_START(at91rm9200) 384AT91_SOC_START(at91rm9200)
389 .map_io = at91rm9200_map_io, 385 .map_io = at91rm9200_map_io,
390 .default_irq_priority = at91rm9200_default_irq_priority, 386 .default_irq_priority = at91rm9200_default_irq_priority,
387 .extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
388 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
389 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
390 | (1 << AT91RM9200_ID_IRQ6),
391 .ioremap_registers = at91rm9200_ioremap_registers, 391 .ioremap_registers = at91rm9200_ioremap_registers,
392 .register_clocks = at91rm9200_register_clocks, 392 .register_clocks = at91rm9200_register_clocks,
393 .init = at91rm9200_initialize, 393 .init = at91rm9200_initialize,
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index a8ce24538da6..5de6074b4f4f 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -348,8 +348,6 @@ static void __init at91sam9260_initialize(void)
348{ 348{
349 arm_pm_idle = at91sam9_idle; 349 arm_pm_idle = at91sam9_idle;
350 arm_pm_restart = at91sam9_alt_restart; 350 arm_pm_restart = at91sam9_alt_restart;
351 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
352 | (1 << AT91SAM9260_ID_IRQ2);
353 351
354 /* Register GPIO subsystem */ 352 /* Register GPIO subsystem */
355 at91_gpio_init(at91sam9260_gpio, 3); 353 at91_gpio_init(at91sam9260_gpio, 3);
@@ -400,6 +398,8 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
400AT91_SOC_START(at91sam9260) 398AT91_SOC_START(at91sam9260)
401 .map_io = at91sam9260_map_io, 399 .map_io = at91sam9260_map_io,
402 .default_irq_priority = at91sam9260_default_irq_priority, 400 .default_irq_priority = at91sam9260_default_irq_priority,
401 .extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
402 | (1 << AT91SAM9260_ID_IRQ2),
403 .ioremap_registers = at91sam9260_ioremap_registers, 403 .ioremap_registers = at91sam9260_ioremap_registers,
404 .register_clocks = at91sam9260_register_clocks, 404 .register_clocks = at91sam9260_register_clocks,
405 .init = at91sam9260_initialize, 405 .init = at91sam9260_initialize,
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 25efb5ac30f1..0e0793241ab7 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -290,8 +290,6 @@ static void __init at91sam9261_initialize(void)
290{ 290{
291 arm_pm_idle = at91sam9_idle; 291 arm_pm_idle = at91sam9_idle;
292 arm_pm_restart = at91sam9_alt_restart; 292 arm_pm_restart = at91sam9_alt_restart;
293 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
294 | (1 << AT91SAM9261_ID_IRQ2);
295 293
296 /* Register GPIO subsystem */ 294 /* Register GPIO subsystem */
297 at91_gpio_init(at91sam9261_gpio, 3); 295 at91_gpio_init(at91sam9261_gpio, 3);
@@ -342,6 +340,8 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
342AT91_SOC_START(at91sam9261) 340AT91_SOC_START(at91sam9261)
343 .map_io = at91sam9261_map_io, 341 .map_io = at91sam9261_map_io,
344 .default_irq_priority = at91sam9261_default_irq_priority, 342 .default_irq_priority = at91sam9261_default_irq_priority,
343 .extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
344 | (1 << AT91SAM9261_ID_IRQ2),
345 .ioremap_registers = at91sam9261_ioremap_registers, 345 .ioremap_registers = at91sam9261_ioremap_registers,
346 .register_clocks = at91sam9261_register_clocks, 346 .register_clocks = at91sam9261_register_clocks,
347 .init = at91sam9261_initialize, 347 .init = at91sam9261_initialize,
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index f44ffd2105a7..6ce7d1850893 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -327,7 +327,6 @@ static void __init at91sam9263_initialize(void)
327{ 327{
328 arm_pm_idle = at91sam9_idle; 328 arm_pm_idle = at91sam9_idle;
329 arm_pm_restart = at91sam9_alt_restart; 329 arm_pm_restart = at91sam9_alt_restart;
330 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
331 330
332 /* Register GPIO subsystem */ 331 /* Register GPIO subsystem */
333 at91_gpio_init(at91sam9263_gpio, 5); 332 at91_gpio_init(at91sam9263_gpio, 5);
@@ -378,6 +377,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
378AT91_SOC_START(at91sam9263) 377AT91_SOC_START(at91sam9263)
379 .map_io = at91sam9263_map_io, 378 .map_io = at91sam9263_map_io,
380 .default_irq_priority = at91sam9263_default_irq_priority, 379 .default_irq_priority = at91sam9263_default_irq_priority,
380 .extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1),
381 .ioremap_registers = at91sam9263_ioremap_registers, 381 .ioremap_registers = at91sam9263_ioremap_registers,
382 .register_clocks = at91sam9263_register_clocks, 382 .register_clocks = at91sam9263_register_clocks,
383 .init = at91sam9263_initialize, 383 .init = at91sam9263_initialize,
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 8b7fce067652..fda502691686 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -374,7 +374,6 @@ static void __init at91sam9g45_initialize(void)
374{ 374{
375 arm_pm_idle = at91sam9_idle; 375 arm_pm_idle = at91sam9_idle;
376 arm_pm_restart = at91sam9g45_restart; 376 arm_pm_restart = at91sam9g45_restart;
377 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
378 377
379 /* Register GPIO subsystem */ 378 /* Register GPIO subsystem */
380 at91_gpio_init(at91sam9g45_gpio, 5); 379 at91_gpio_init(at91sam9g45_gpio, 5);
@@ -425,6 +424,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {
425AT91_SOC_START(at91sam9g45) 424AT91_SOC_START(at91sam9g45)
426 .map_io = at91sam9g45_map_io, 425 .map_io = at91sam9g45_map_io,
427 .default_irq_priority = at91sam9g45_default_irq_priority, 426 .default_irq_priority = at91sam9g45_default_irq_priority,
427 .extern_irq = (1 << AT91SAM9G45_ID_IRQ0),
428 .ioremap_registers = at91sam9g45_ioremap_registers, 428 .ioremap_registers = at91sam9g45_ioremap_registers,
429 .register_clocks = at91sam9g45_register_clocks, 429 .register_clocks = at91sam9g45_register_clocks,
430 .init = at91sam9g45_initialize, 430 .init = at91sam9g45_initialize,
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index f77fae5591bc..d4ec0d9a9872 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -293,7 +293,6 @@ static void __init at91sam9rl_initialize(void)
293{ 293{
294 arm_pm_idle = at91sam9_idle; 294 arm_pm_idle = at91sam9_idle;
295 arm_pm_restart = at91sam9_alt_restart; 295 arm_pm_restart = at91sam9_alt_restart;
296 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
297 296
298 /* Register GPIO subsystem */ 297 /* Register GPIO subsystem */
299 at91_gpio_init(at91sam9rl_gpio, 4); 298 at91_gpio_init(at91sam9rl_gpio, 4);
@@ -344,6 +343,7 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
344AT91_SOC_START(at91sam9rl) 343AT91_SOC_START(at91sam9rl)
345 .map_io = at91sam9rl_map_io, 344 .map_io = at91sam9rl_map_io,
346 .default_irq_priority = at91sam9rl_default_irq_priority, 345 .default_irq_priority = at91sam9rl_default_irq_priority,
346 .extern_irq = (1 << AT91SAM9RL_ID_IRQ0),
347 .ioremap_registers = at91sam9rl_ioremap_registers, 347 .ioremap_registers = at91sam9rl_ioremap_registers,
348 .register_clocks = at91sam9rl_register_clocks, 348 .register_clocks = at91sam9rl_register_clocks,
349 .init = at91sam9rl_initialize, 349 .init = at91sam9rl_initialize,
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index 19ca79396905..bad94b84a46f 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -55,8 +55,6 @@ static void at91x40_idle(void)
55void __init at91x40_initialize(unsigned long main_clock) 55void __init at91x40_initialize(unsigned long main_clock)
56{ 56{
57 arm_pm_idle = at91x40_idle; 57 arm_pm_idle = at91x40_idle;
58 at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
59 | (1 << AT91X40_ID_IRQ2);
60} 58}
61 59
62/* 60/*
@@ -86,9 +84,10 @@ static unsigned int at91x40_default_irq_priority[NR_AIC_IRQS] __initdata = {
86 84
87void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 85void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS])
88{ 86{
87 u32 extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
88 | (1 << AT91X40_ID_IRQ2);
89 if (!priority) 89 if (!priority)
90 priority = at91x40_default_irq_priority; 90 priority = at91x40_default_irq_priority;
91 91
92 at91_aic_init(priority, at91_extern_irq); 92 at91_aic_init(priority, extern_irq);
93} 93}
94
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index da841885d01c..6b2630a92f71 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(at91_pmc_base);
75#define cpu_has_pllb() (!(cpu_is_at91sam9rl() \ 75#define cpu_has_pllb() (!(cpu_is_at91sam9rl() \
76 || cpu_is_at91sam9g45() \ 76 || cpu_is_at91sam9g45() \
77 || cpu_is_at91sam9x5() \ 77 || cpu_is_at91sam9x5() \
78 || cpu_is_at91sam9n12())) 78 || cpu_is_sama5d3()))
79 79
80#define cpu_has_upll() (cpu_is_at91sam9g45() \ 80#define cpu_has_upll() (cpu_is_at91sam9g45() \
81 || cpu_is_at91sam9x5() \ 81 || cpu_is_at91sam9x5() \
@@ -489,7 +489,7 @@ static int at91_clk_show(struct seq_file *s, void *unused)
489 seq_printf(s, "UCKR = %8x\n", uckr); 489 seq_printf(s, "UCKR = %8x\n", uckr);
490 } 490 }
491 seq_printf(s, "MCKR = %8x\n", at91_pmc_read(AT91_PMC_MCKR)); 491 seq_printf(s, "MCKR = %8x\n", at91_pmc_read(AT91_PMC_MCKR));
492 if (cpu_has_upll()) 492 if (cpu_has_upll() || cpu_is_at91sam9n12())
493 seq_printf(s, "USB = %8x\n", at91_pmc_read(AT91_PMC_USB)); 493 seq_printf(s, "USB = %8x\n", at91_pmc_read(AT91_PMC_USB));
494 seq_printf(s, "SR = %8x\n", sr); 494 seq_printf(s, "SR = %8x\n", sr);
495 495
@@ -614,6 +614,8 @@ static u32 __init at91_usb_rate(struct clk *pll, u32 freq, u32 reg)
614{ 614{
615 if (pll == &pllb && (reg & AT91_PMC_USB96M)) 615 if (pll == &pllb && (reg & AT91_PMC_USB96M))
616 return freq / 2; 616 return freq / 2;
617 else if (pll == &utmi_clk || cpu_is_at91sam9n12())
618 return freq / (1 + ((reg & AT91_PMC_OHCIUSBDIV) >> 8));
617 else 619 else
618 return freq; 620 return freq;
619} 621}
@@ -683,6 +685,8 @@ static struct clk *const standard_pmc_clocks[] __initconst = {
683/* PLLB generated USB full speed clock init */ 685/* PLLB generated USB full speed clock init */
684static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock) 686static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
685{ 687{
688 unsigned int reg;
689
686 /* 690 /*
687 * USB clock init: choose 48 MHz PLLB value, 691 * USB clock init: choose 48 MHz PLLB value,
688 * disable 48MHz clock during usb peripheral suspend. 692 * disable 48MHz clock during usb peripheral suspend.
@@ -691,22 +695,35 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
691 */ 695 */
692 uhpck.parent = &pllb; 696 uhpck.parent = &pllb;
693 697
694 at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M; 698 reg = at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2);
695 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init); 699 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
696 if (cpu_is_at91rm9200()) { 700 if (cpu_is_at91rm9200()) {
701 reg = at91_pllb_usb_init |= AT91_PMC_USB96M;
697 uhpck.pmc_mask = AT91RM9200_PMC_UHP; 702 uhpck.pmc_mask = AT91RM9200_PMC_UHP;
698 udpck.pmc_mask = AT91RM9200_PMC_UDP; 703 udpck.pmc_mask = AT91RM9200_PMC_UDP;
699 at91_pmc_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); 704 at91_pmc_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
700 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || 705 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
701 cpu_is_at91sam9263() || cpu_is_at91sam9g20() || 706 cpu_is_at91sam9263() || cpu_is_at91sam9g20() ||
702 cpu_is_at91sam9g10()) { 707 cpu_is_at91sam9g10()) {
708 reg = at91_pllb_usb_init |= AT91_PMC_USB96M;
709 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
710 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
711 } else if (cpu_is_at91sam9n12()) {
712 /* Divider for USB clock is in USB clock register for 9n12 */
713 reg = AT91_PMC_USBS_PLLB;
714
715 /* For PLLB output 96M, set usb divider 2 (USBDIV + 1) */
716 reg |= AT91_PMC_OHCIUSBDIV_2;
717 at91_pmc_write(AT91_PMC_USB, reg);
718
719 /* Still setup masks */
703 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 720 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
704 udpck.pmc_mask = AT91SAM926x_PMC_UDP; 721 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
705 } 722 }
706 at91_pmc_write(AT91_CKGR_PLLBR, 0); 723 at91_pmc_write(AT91_CKGR_PLLBR, 0);
707 724
708 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); 725 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, reg);
709 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init); 726 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, reg);
710} 727}
711 728
712/* UPLL generated USB full speed clock init */ 729/* UPLL generated USB full speed clock init */
@@ -725,8 +742,7 @@ static void __init at91_upll_usbfs_clock_init(unsigned long main_clock)
725 /* Now set uhpck values */ 742 /* Now set uhpck values */
726 uhpck.parent = &utmi_clk; 743 uhpck.parent = &utmi_clk;
727 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 744 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
728 uhpck.rate_hz = utmi_clk.rate_hz; 745 uhpck.rate_hz = at91_usb_rate(&utmi_clk, utmi_clk.rate_hz, usbr);
729 uhpck.rate_hz /= 1 + ((at91_pmc_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8);
730} 746}
731 747
732static int __init at91_pmc_init(unsigned long main_clock) 748static int __init at91_pmc_init(unsigned long main_clock)
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
index 69f9e3bbf4e5..4ec6a6d9b9be 100644
--- a/arch/arm/mach-at91/cpuidle.c
+++ b/arch/arm/mach-at91/cpuidle.c
@@ -51,7 +51,7 @@ static struct cpuidle_driver at91_idle_driver = {
51 .states[1] = { 51 .states[1] = {
52 .enter = at91_enter_idle, 52 .enter = at91_enter_idle,
53 .exit_latency = 10, 53 .exit_latency = 10,
54 .target_residency = 100000, 54 .target_residency = 10000,
55 .flags = CPUIDLE_FLAG_TIME_VALID, 55 .flags = CPUIDLE_FLAG_TIME_VALID,
56 .name = "RAM_SR", 56 .name = "RAM_SR",
57 .desc = "WFI and DDR Self Refresh", 57 .desc = "WFI and DDR Self Refresh",
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 78ab06548658..f6de36aefe85 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -85,4 +85,4 @@ extern void __init at91_gpio_irq_setup(void);
85extern int __init at91_gpio_of_irq_setup(struct device_node *node, 85extern int __init at91_gpio_of_irq_setup(struct device_node *node,
86 struct device_node *parent); 86 struct device_node *parent);
87 87
88extern int at91_extern_irq; 88extern u32 at91_get_extern_irq(void);
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index 2bd7f51b0b82..c604cc69acb5 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -130,7 +130,10 @@ extern void __iomem *at91_pmc_base;
130#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */ 130#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */
131#define AT91_PMC_USBS_PLLA (0 << 0) 131#define AT91_PMC_USBS_PLLA (0 << 0)
132#define AT91_PMC_USBS_UPLL (1 << 0) 132#define AT91_PMC_USBS_UPLL (1 << 0)
133#define AT91_PMC_USBS_PLLB (1 << 0) /* [AT91SAMN12 only] */
133#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */ 134#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */
135#define AT91_PMC_OHCIUSBDIV_1 (0x0 << 8)
136#define AT91_PMC_OHCIUSBDIV_2 (0x1 << 8)
134 137
135#define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */ 138#define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */
136#define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */ 139#define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
index e0ca59171022..3d192c5aee66 100644
--- a/arch/arm/mach-at91/irq.c
+++ b/arch/arm/mach-at91/irq.c
@@ -232,7 +232,14 @@ static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
232 at91_aic_write(AT91_AIC5_EOICR, 0); 232 at91_aic_write(AT91_AIC5_EOICR, 0);
233} 233}
234 234
235unsigned long *at91_extern_irq; 235static unsigned long *at91_extern_irq;
236
237u32 at91_get_extern_irq(void)
238{
239 if (!at91_extern_irq)
240 return 0;
241 return *at91_extern_irq;
242}
236 243
237#define is_extern_irq(hwirq) test_bit(hwirq, at91_extern_irq) 244#define is_extern_irq(hwirq) test_bit(hwirq, at91_extern_irq)
238 245
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 530db304ec5e..15afb5d9271f 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -212,7 +212,7 @@ static int at91_pm_enter(suspend_state_t state)
212 (at91_pmc_read(AT91_PMC_PCSR) 212 (at91_pmc_read(AT91_PMC_PCSR)
213 | (1 << AT91_ID_FIQ) 213 | (1 << AT91_ID_FIQ)
214 | (1 << AT91_ID_SYS) 214 | (1 << AT91_ID_SYS)
215 | (at91_extern_irq)) 215 | (at91_get_extern_irq()))
216 & at91_aic_read(AT91_AIC_IMR), 216 & at91_aic_read(AT91_AIC_IMR),
217 state); 217 state);
218 218
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 942dc00f1227..b17fbcf4d9e8 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -48,7 +48,7 @@ void __init at91_init_irq_default(void)
48void __init at91_init_interrupts(unsigned int *priority) 48void __init at91_init_interrupts(unsigned int *priority)
49{ 49{
50 /* Initialize the AIC interrupt controller */ 50 /* Initialize the AIC interrupt controller */
51 at91_aic_init(priority, at91_extern_irq); 51 at91_aic_init(priority, at91_boot_soc.extern_irq);
52 52
53 /* Enable GPIO interrupts */ 53 /* Enable GPIO interrupts */
54 at91_gpio_irq_setup(); 54 at91_gpio_irq_setup();
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 43a225f9e713..a1e1482c6da8 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -6,6 +6,7 @@
6 6
7struct at91_init_soc { 7struct at91_init_soc {
8 int builtin; 8 int builtin;
9 u32 extern_irq;
9 unsigned int *default_irq_priority; 10 unsigned int *default_irq_priority;
10 void (*map_io)(void); 11 void (*map_io)(void);
11 void (*ioremap_registers)(void); 12 void (*ioremap_registers)(void);