Skip to content

Commit

Permalink
Merge tag 'nios2-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
torvalds committed Sep 15, 2017
2 parents 418702b + 65d1e3d commit 866a30e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arch/nios2/boot/dts/3c120_devboard.dts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
};

chosen {
bootargs = "debug console=ttyJ0,115200";
bootargs = "debug earlycon console=ttyJ0,115200";
stdout-path = &jtag_uart;
};
};
5 changes: 4 additions & 1 deletion arch/nios2/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ static struct nios2_clocksource nios2_cs = {

cycles_t get_cycles(void)
{
return nios2_timer_read(&nios2_cs.cs);
/* Only read timer if it has been initialized */
if (nios2_cs.timer.base)
return nios2_timer_read(&nios2_cs.cs);
return 0;
}
EXPORT_SYMBOL(get_cycles);

Expand Down

0 comments on commit 866a30e

Please sign in to comment.