aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2015-01-08 17:43:00 -0500
committerOlof Johansson <olof@lixom.net>2015-01-16 22:10:37 -0500
commite3db2217f3cdabf170ed2131831b42aa0878a0ac (patch)
treeb0ae8399578ed6b1a52ebecc7b11f2583edfe224
parent3be8142951e87beb9a69efbfea0f4041c893c09f (diff)
parent7ac72746aa9bb305fa74b44ec73eae99bbbe9b66 (diff)
Merge tag 'omap-for-v3.19/fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
Merge "omap fixes against v3.19-rc1" from Tony Lindgren: Fixes for omaps mostly to deal with dra7 timer issues and hypervisor mode. The other fixes are minor fixes for various boards. The summary of the fixes is: - Fix real-time counter rate typos for some frequencies - Fix counter frequency drift for am572x - Fix booting of secondary CPU in HYP mode - Fix n900 board name for legacy user space - Fix cpufreq in omap2plus_defconfig after Kconfig change - Fix dra7 qspi partitions And also, let's re-enable smc91x on some n900 boards that we have sitting in a few test boot systems after the boot loader dependencies got fixed. * tag 'omap-for-v3.19/fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Revert disabling of smc91x for n900 ARM: dts: dra7-evm: fix qspi device tree partition size ARM: omap2plus_defconfig: use CONFIG_CPUFREQ_DT ARM: OMAP2+: Fix n900 board name for legacy user space ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode ARM: dra7xx: Fix counter frequency drift for AM572x errata i856 ARM: omap5/dra7xx: Fix frequency typos Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/boot/dts/dra7-evm.dts10
-rw-r--r--arch/arm/boot/dts/omap3-n900.dts4
-rw-r--r--arch/arm/configs/omap2plus_defconfig2
-rw-r--r--arch/arm/mach-omap2/board-generic.c18
-rw-r--r--arch/arm/mach-omap2/common.h1
-rw-r--r--arch/arm/mach-omap2/control.h4
-rw-r--r--arch/arm/mach-omap2/omap-headsmp.S21
-rw-r--r--arch/arm/mach-omap2/omap-smp.c13
-rw-r--r--arch/arm/mach-omap2/timer.c44
9 files changed, 100 insertions, 17 deletions
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 10b725c7bfc0..ad4118f7e1a6 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -499,23 +499,23 @@
499 }; 499 };
500 partition@5 { 500 partition@5 {
501 label = "QSPI.u-boot-spl-os"; 501 label = "QSPI.u-boot-spl-os";
502 reg = <0x00140000 0x00010000>; 502 reg = <0x00140000 0x00080000>;
503 }; 503 };
504 partition@6 { 504 partition@6 {
505 label = "QSPI.u-boot-env"; 505 label = "QSPI.u-boot-env";
506 reg = <0x00150000 0x00010000>; 506 reg = <0x001c0000 0x00010000>;
507 }; 507 };
508 partition@7 { 508 partition@7 {
509 label = "QSPI.u-boot-env.backup1"; 509 label = "QSPI.u-boot-env.backup1";
510 reg = <0x00160000 0x0010000>; 510 reg = <0x001d0000 0x0010000>;
511 }; 511 };
512 partition@8 { 512 partition@8 {
513 label = "QSPI.kernel"; 513 label = "QSPI.kernel";
514 reg = <0x00170000 0x0800000>; 514 reg = <0x001e0000 0x0800000>;
515 }; 515 };
516 partition@9 { 516 partition@9 {
517 label = "QSPI.file-system"; 517 label = "QSPI.file-system";
518 reg = <0x00970000 0x01690000>; 518 reg = <0x009e0000 0x01620000>;
519 }; 519 };
520 }; 520 };
521}; 521};
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 53f3ca064140..b550c41b46f1 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -700,11 +700,9 @@
700 }; 700 };
701 }; 701 };
702 702
703 /* Ethernet is on some early development boards and qemu */
703 ethernet@gpmc { 704 ethernet@gpmc {
704 compatible = "smsc,lan91c94"; 705 compatible = "smsc,lan91c94";
705
706 status = "disabled";
707
708 interrupt-parent = <&gpio2>; 706 interrupt-parent = <&gpio2>;
709 interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */ 707 interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; /* gpio54 */
710 reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */ 708 reg = <1 0x300 0xf>; /* 16 byte IO range at offset 0x300 */
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index c2c3a852af9f..667d9d52aa01 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -68,7 +68,7 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
68CONFIG_CPU_FREQ_GOV_POWERSAVE=y 68CONFIG_CPU_FREQ_GOV_POWERSAVE=y
69CONFIG_CPU_FREQ_GOV_USERSPACE=y 69CONFIG_CPU_FREQ_GOV_USERSPACE=y
70CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 70CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
71CONFIG_GENERIC_CPUFREQ_CPU0=y 71CONFIG_CPUFREQ_DT=y
72# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set 72# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set
73CONFIG_CPU_IDLE=y 73CONFIG_CPU_IDLE=y
74CONFIG_BINFMT_MISC=y 74CONFIG_BINFMT_MISC=y
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 608079a1aba6..b61c049f92d6 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -77,6 +77,24 @@ MACHINE_END
77#endif 77#endif
78 78
79#ifdef CONFIG_ARCH_OMAP3 79#ifdef CONFIG_ARCH_OMAP3
80/* Some boards need board name for legacy userspace in /proc/cpuinfo */
81static const char *const n900_boards_compat[] __initconst = {
82 "nokia,omap3-n900",
83 NULL,
84};
85
86DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
87 .reserve = omap_reserve,
88 .map_io = omap3_map_io,
89 .init_early = omap3430_init_early,
90 .init_machine = omap_generic_init,
91 .init_late = omap3_init_late,
92 .init_time = omap3_sync32k_timer_init,
93 .dt_compat = n900_boards_compat,
94 .restart = omap3xxx_restart,
95MACHINE_END
96
97/* Generic omap3 boards, most boards can use these */
80static const char *const omap3_boards_compat[] __initconst = { 98static const char *const omap3_boards_compat[] __initconst = {
81 "ti,omap3430", 99 "ti,omap3430",
82 "ti,omap3", 100 "ti,omap3",
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea849e7b..db57741c9c8a 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -249,6 +249,7 @@ extern void omap4_cpu_die(unsigned int cpu);
249extern struct smp_operations omap4_smp_ops; 249extern struct smp_operations omap4_smp_ops;
250 250
251extern void omap5_secondary_startup(void); 251extern void omap5_secondary_startup(void);
252extern void omap5_secondary_hyp_startup(void);
252#endif 253#endif
253 254
254#if defined(CONFIG_SMP) && defined(CONFIG_PM) 255#if defined(CONFIG_SMP) && defined(CONFIG_PM)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a3c013345c45..a80ac2d70bb1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -286,6 +286,10 @@
286#define OMAP5XXX_CONTROL_STATUS 0x134 286#define OMAP5XXX_CONTROL_STATUS 0x134
287#define OMAP5_DEVICETYPE_MASK (0x7 << 6) 287#define OMAP5_DEVICETYPE_MASK (0x7 << 6)
288 288
289/* DRA7XX CONTROL CORE BOOTSTRAP */
290#define DRA7_CTRL_CORE_BOOTSTRAP 0x6c4
291#define DRA7_SPEEDSELECT_MASK (0x3 << 8)
292
289/* 293/*
290 * REVISIT: This list of registers is not comprehensive - there are more 294 * REVISIT: This list of registers is not comprehensive - there are more
291 * that should be added. 295 * that should be added.
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S
index 4993d4bfe9b2..6d1dffca6c7b 100644
--- a/arch/arm/mach-omap2/omap-headsmp.S
+++ b/arch/arm/mach-omap2/omap-headsmp.S
@@ -22,6 +22,7 @@
22 22
23/* Physical address needed since MMU not enabled yet on secondary core */ 23/* Physical address needed since MMU not enabled yet on secondary core */
24#define AUX_CORE_BOOT0_PA 0x48281800 24#define AUX_CORE_BOOT0_PA 0x48281800
25#define API_HYP_ENTRY 0x102
25 26
26/* 27/*
27 * OMAP5 specific entry point for secondary CPU to jump from ROM 28 * OMAP5 specific entry point for secondary CPU to jump from ROM
@@ -41,6 +42,26 @@ wait: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0
41 b secondary_startup 42 b secondary_startup
42ENDPROC(omap5_secondary_startup) 43ENDPROC(omap5_secondary_startup)
43/* 44/*
45 * Same as omap5_secondary_startup except we call into the ROM to
46 * enable HYP mode first. This is called instead of
47 * omap5_secondary_startup if the primary CPU was put into HYP mode by
48 * the boot loader.
49 */
50ENTRY(omap5_secondary_hyp_startup)
51wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0
52 ldr r0, [r2]
53 mov r0, r0, lsr #5
54 mrc p15, 0, r4, c0, c0, 5
55 and r4, r4, #0x0f
56 cmp r0, r4
57 bne wait_2
58 ldr r12, =API_HYP_ENTRY
59 adr r0, hyp_boot
60 smc #0
61hyp_boot:
62 b secondary_startup
63ENDPROC(omap5_secondary_hyp_startup)
64/*
44 * OMAP4 specific entry point for secondary CPU to jump from ROM 65 * OMAP4 specific entry point for secondary CPU to jump from ROM
45 * code. This routine also provides a holding flag into which 66 * code. This routine also provides a holding flag into which
46 * secondary core is held until we're ready for it to initialise. 67 * secondary core is held until we're ready for it to initialise.
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 256e84ef0f67..5305ec7341ec 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -22,6 +22,7 @@
22#include <linux/irqchip/arm-gic.h> 22#include <linux/irqchip/arm-gic.h>
23 23
24#include <asm/smp_scu.h> 24#include <asm/smp_scu.h>
25#include <asm/virt.h>
25 26
26#include "omap-secure.h" 27#include "omap-secure.h"
27#include "omap-wakeupgen.h" 28#include "omap-wakeupgen.h"
@@ -227,8 +228,16 @@ static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
227 if (omap_secure_apis_support()) 228 if (omap_secure_apis_support())
228 omap_auxcoreboot_addr(virt_to_phys(startup_addr)); 229 omap_auxcoreboot_addr(virt_to_phys(startup_addr));
229 else 230 else
230 writel_relaxed(virt_to_phys(omap5_secondary_startup), 231 /*
231 base + OMAP_AUX_CORE_BOOT_1); 232 * If the boot CPU is in HYP mode then start secondary
233 * CPU in HYP mode as well.
234 */
235 if ((__boot_cpu_mode & MODE_MASK) == HYP_MODE)
236 writel_relaxed(virt_to_phys(omap5_secondary_hyp_startup),
237 base + OMAP_AUX_CORE_BOOT_1);
238 else
239 writel_relaxed(virt_to_phys(omap5_secondary_startup),
240 base + OMAP_AUX_CORE_BOOT_1);
232 241
233} 242}
234 243
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f61148ec168..7d45c84c69ba 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -54,6 +54,7 @@
54 54
55#include "soc.h" 55#include "soc.h"
56#include "common.h" 56#include "common.h"
57#include "control.h"
57#include "powerdomain.h" 58#include "powerdomain.h"
58#include "omap-secure.h" 59#include "omap-secure.h"
59 60
@@ -496,7 +497,8 @@ static void __init realtime_counter_init(void)
496 void __iomem *base; 497 void __iomem *base;
497 static struct clk *sys_clk; 498 static struct clk *sys_clk;
498 unsigned long rate; 499 unsigned long rate;
499 unsigned int reg, num, den; 500 unsigned int reg;
501 unsigned long long num, den;
500 502
501 base = ioremap(REALTIME_COUNTER_BASE, SZ_32); 503 base = ioremap(REALTIME_COUNTER_BASE, SZ_32);
502 if (!base) { 504 if (!base) {
@@ -511,13 +513,42 @@ static void __init realtime_counter_init(void)
511 } 513 }
512 514
513 rate = clk_get_rate(sys_clk); 515 rate = clk_get_rate(sys_clk);
516
517 if (soc_is_dra7xx()) {
518 /*
519 * Errata i856 says the 32.768KHz crystal does not start at
520 * power on, so the CPU falls back to an emulated 32KHz clock
521 * based on sysclk / 610 instead. This causes the master counter
522 * frequency to not be 6.144MHz but at sysclk / 610 * 375 / 2
523 * (OR sysclk * 75 / 244)
524 *
525 * This affects at least the DRA7/AM572x 1.0, 1.1 revisions.
526 * Of course any board built without a populated 32.768KHz
527 * crystal would also need this fix even if the CPU is fixed
528 * later.
529 *
530 * Either case can be detected by using the two speedselect bits
531 * If they are not 0, then the 32.768KHz clock driving the
532 * coarse counter that corrects the fine counter every time it
533 * ticks is actually rate/610 rather than 32.768KHz and we
534 * should compensate to avoid the 570ppm (at 20MHz, much worse
535 * at other rates) too fast system time.
536 */
537 reg = omap_ctrl_readl(DRA7_CTRL_CORE_BOOTSTRAP);
538 if (reg & DRA7_SPEEDSELECT_MASK) {
539 num = 75;
540 den = 244;
541 goto sysclk1_based;
542 }
543 }
544
514 /* Numerator/denumerator values refer TRM Realtime Counter section */ 545 /* Numerator/denumerator values refer TRM Realtime Counter section */
515 switch (rate) { 546 switch (rate) {
516 case 1200000: 547 case 12000000:
517 num = 64; 548 num = 64;
518 den = 125; 549 den = 125;
519 break; 550 break;
520 case 1300000: 551 case 13000000:
521 num = 768; 552 num = 768;
522 den = 1625; 553 den = 1625;
523 break; 554 break;
@@ -529,11 +560,11 @@ static void __init realtime_counter_init(void)
529 num = 192; 560 num = 192;
530 den = 625; 561 den = 625;
531 break; 562 break;
532 case 2600000: 563 case 26000000:
533 num = 384; 564 num = 384;
534 den = 1625; 565 den = 1625;
535 break; 566 break;
536 case 2700000: 567 case 27000000:
537 num = 256; 568 num = 256;
538 den = 1125; 569 den = 1125;
539 break; 570 break;
@@ -545,6 +576,7 @@ static void __init realtime_counter_init(void)
545 break; 576 break;
546 } 577 }
547 578
579sysclk1_based:
548 /* Program numerator and denumerator registers */ 580 /* Program numerator and denumerator registers */
549 reg = readl_relaxed(base + INCREMENTER_NUMERATOR_OFFSET) & 581 reg = readl_relaxed(base + INCREMENTER_NUMERATOR_OFFSET) &
550 NUMERATOR_DENUMERATOR_MASK; 582 NUMERATOR_DENUMERATOR_MASK;
@@ -556,7 +588,7 @@ static void __init realtime_counter_init(void)
556 reg |= den; 588 reg |= den;
557 writel_relaxed(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET); 589 writel_relaxed(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
558 590
559 arch_timer_freq = (rate / den) * num; 591 arch_timer_freq = DIV_ROUND_UP_ULL(rate * num, den);
560 set_cntfreq(); 592 set_cntfreq();
561 593
562 iounmap(base); 594 iounmap(base);