Skip to content

Commit 866a30e

Browse files
committed
Merge tag 'nios2-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2
Pull arch/nios2 update from Ley Foon Tan. * tag 'nios2-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: time: Read timer in get_cycles only if initialized nios2: add earlycon support to 3c120 devboard DTS
2 parents 418702b + 65d1e3d commit 866a30e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

arch/nios2/boot/dts/3c120_devboard.dts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
};
160160

161161
chosen {
162-
bootargs = "debug console=ttyJ0,115200";
162+
bootargs = "debug earlycon console=ttyJ0,115200";
163+
stdout-path = &jtag_uart;
163164
};
164165
};

arch/nios2/kernel/time.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ static struct nios2_clocksource nios2_cs = {
107107

108108
cycles_t get_cycles(void)
109109
{
110-
return nios2_timer_read(&nios2_cs.cs);
110+
/* Only read timer if it has been initialized */
111+
if (nios2_cs.timer.base)
112+
return nios2_timer_read(&nios2_cs.cs);
113+
return 0;
111114
}
112115
EXPORT_SYMBOL(get_cycles);
113116

0 commit comments

Comments
 (0)