| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * OpenRISC head.S |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * Modifications for the OpenRISC architecture: |
|---|
| 9 | 10 | * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> |
|---|
| 10 | 11 | * 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. |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | |
|---|
| 18 | 14 | #include <linux/linkage.h> |
|---|
| .. | .. |
|---|
| 20 | 16 | #include <linux/errno.h> |
|---|
| 21 | 17 | #include <linux/init.h> |
|---|
| 22 | 18 | #include <linux/serial_reg.h> |
|---|
| 19 | +#include <linux/pgtable.h> |
|---|
| 23 | 20 | #include <asm/processor.h> |
|---|
| 24 | 21 | #include <asm/page.h> |
|---|
| 25 | 22 | #include <asm/mmu.h> |
|---|
| 26 | | -#include <asm/pgtable.h> |
|---|
| 27 | 23 | #include <asm/thread_info.h> |
|---|
| 28 | 24 | #include <asm/cache.h> |
|---|
| 29 | 25 | #include <asm/spr_defs.h> |
|---|
| .. | .. |
|---|
| 525 | 521 | l.ori r3,r0,0x1 |
|---|
| 526 | 522 | l.mtspr r0,r3,SPR_SR |
|---|
| 527 | 523 | |
|---|
| 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 | + |
|---|
| 528 | 533 | CLEAR_GPR(r1) |
|---|
| 529 | 534 | CLEAR_GPR(r2) |
|---|
| 530 | 535 | CLEAR_GPR(r3) |
|---|