blob: 9ec3dd46b70e1d1d3d222110b4273a7c064f7820 [file] [log] [blame]
Chia-Wei, Wang21222102020-08-03 17:36:06 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) ASPEED Technology Inc.
4 */
5#include <asm/arch/scu_ast2500.h>
6
7/* registers for low level init */
8#define SCU_PROT_KEY 0x1e6e2000
9#define SCU_VGA_HANDSHAKE 0x1e6e2040
10#define SCU_HW_STRAP 0x1e6e2070
11#define SCU_HW_STRAP_CLR 0x1e6e207c
12#define WDT3_CTRL 0x1e78504c
13
14.global lowlevel_init
15lowlevel_init:
16
17 /* unlock SCU */
18 ldr r0, =SCU_PROT_KEY
19 ldr r1, =SCU_UNLOCK_VALUE
20 str r1, [r0]
21
22 /* set BMC FW as DRAM initializer */
23 ldr r0, =SCU_VGA_HANDSHAKE
24 ldr r1, [r0]
25 orr r1, #0x80
26 str r1, [r0]
27
28 /* set PERST# as LPC reset source if eSPI mode is enabled*/
29 ldr r0, =SCU_HW_STRAP
30 ldr r1, [r0]
31 tst r1, #(0x1 << 25)
32 ldrne r0, =SCU_HW_STRAP_CLR
33 movne r1, #(0x1 << 14)
34 strne r1, [r0]
35
36 /* disable WDT3 for SPI 3/4 bytes auto-detection */
37 ldr r0, =WDT3_CTRL
38 mov r1, #0x0
39 str r1, [r0]
40
41 mov pc, lr