| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ARC CPU startup Code |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * Vineetg: Dec 2007 |
|---|
| 11 | 8 | * -Check if we are running on Simulator or on real hardware |
|---|
| .. | .. |
|---|
| 17 | 14 | #include <asm/entry.h> |
|---|
| 18 | 15 | #include <asm/arcregs.h> |
|---|
| 19 | 16 | #include <asm/cache.h> |
|---|
| 17 | +#include <asm/dsp-impl.h> |
|---|
| 20 | 18 | #include <asm/irqflags.h> |
|---|
| 21 | 19 | |
|---|
| 22 | 20 | .macro CPU_EARLY_SETUP |
|---|
| .. | .. |
|---|
| 54 | 52 | ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access |
|---|
| 55 | 53 | ; by default |
|---|
| 56 | 54 | lr r5, [status32] |
|---|
| 55 | +#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS |
|---|
| 57 | 56 | bset r5, r5, STATUS_AD_BIT |
|---|
| 58 | | - kflag r5 |
|---|
| 57 | +#else |
|---|
| 58 | + ; Although disabled at reset, bootloader might have enabled it |
|---|
| 59 | + bclr r5, r5, STATUS_AD_BIT |
|---|
| 59 | 60 | #endif |
|---|
| 61 | + kflag r5 |
|---|
| 62 | + |
|---|
| 63 | +#ifdef CONFIG_ARC_LPB_DISABLE |
|---|
| 64 | + lr r5, [ARC_REG_LPB_BUILD] |
|---|
| 65 | + breq r5, 0, 1f ; LPB doesn't exist |
|---|
| 66 | + mov r5, 1 |
|---|
| 67 | + sr r5, [ARC_REG_LPB_CTRL] |
|---|
| 68 | +1: |
|---|
| 69 | +#endif /* CONFIG_ARC_LPB_DISABLE */ |
|---|
| 70 | + |
|---|
| 71 | + /* On HSDK, CCMs need to remapped super early */ |
|---|
| 72 | +#ifdef CONFIG_ARC_SOC_HSDK |
|---|
| 73 | + mov r6, 0x60000000 |
|---|
| 74 | + lr r5, [ARC_REG_ICCM_BUILD] |
|---|
| 75 | + breq r5, 0, 1f |
|---|
| 76 | + sr r6, [ARC_REG_AUX_ICCM] |
|---|
| 77 | +1: |
|---|
| 78 | + lr r5, [ARC_REG_DCCM_BUILD] |
|---|
| 79 | + breq r5, 0, 2f |
|---|
| 80 | + sr r6, [ARC_REG_AUX_DCCM] |
|---|
| 81 | +2: |
|---|
| 82 | +#endif /* CONFIG_ARC_SOC_HSDK */ |
|---|
| 83 | + |
|---|
| 84 | +#endif /* CONFIG_ISA_ARCV2 */ |
|---|
| 85 | + |
|---|
| 86 | + ; Config DSP_CTRL properly, so kernel may use integer multiply, |
|---|
| 87 | + ; multiply-accumulate, and divide operations |
|---|
| 88 | + DSP_EARLY_INIT |
|---|
| 60 | 89 | .endm |
|---|
| 61 | 90 | |
|---|
| 62 | 91 | .section .init.text, "ax",@progbits |
|---|