hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/openrisc/kernel/head.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * OpenRISC head.S
34 *
....@@ -8,11 +9,6 @@
89 * Modifications for the OpenRISC architecture:
910 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
1011 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
11
- *
12
- * This program is free software; you can redistribute it and/or
13
- * modify it under the terms of the GNU General Public License
14
- * as published by the Free Software Foundation; either version
15
- * 2 of the License, or (at your option) any later version.
1612 */
1713
1814 #include <linux/linkage.h>
....@@ -20,10 +16,10 @@
2016 #include <linux/errno.h>
2117 #include <linux/init.h>
2218 #include <linux/serial_reg.h>
19
+#include <linux/pgtable.h>
2320 #include <asm/processor.h>
2421 #include <asm/page.h>
2522 #include <asm/mmu.h>
26
-#include <asm/pgtable.h>
2723 #include <asm/thread_info.h>
2824 #include <asm/cache.h>
2925 #include <asm/spr_defs.h>
....@@ -525,6 +521,15 @@
525521 l.ori r3,r0,0x1
526522 l.mtspr r0,r3,SPR_SR
527523
524
+ /*
525
+ * Start the TTCR as early as possible, so that the RNG can make use of
526
+ * measurements of boot time from the earliest opportunity. Especially
527
+ * important is that the TTCR does not return zero by the time we reach
528
+ * rand_initialize().
529
+ */
530
+ l.movhi r3,hi(SPR_TTMR_CR)
531
+ l.mtspr r0,r3,SPR_TTMR
532
+
528533 CLEAR_GPR(r1)
529534 CLEAR_GPR(r2)
530535 CLEAR_GPR(r3)