blob: 42c64f3ca5e66faebaf702bffe0ccc018c568dee [file] [log] [blame]
Tianrui Wei2ef594d2021-07-01 12:54:19 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (c) 2019 Western Digital Corporation or its affiliates.
4 * Copyright (c) 2021 Tianrui Wei
5 *
6 * Authors:
7 * Anup Patel <anup.patel@wdc.com>
8 * Tianrui Wei <tianrui-wei@outlook.com>
9 */
10
11#ifndef __OPENPITON_RISCV64_CONFIG_H
12#define __OPENPITON_RISCV64_CONFIG_H
13
14#include <linux/sizes.h>
15
16/* Environment options */
17#define CONFIG_SYS_SDRAM_BASE 0x80000000
18#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_32M)
19#define CONFIG_SYS_LOAD_ADDR 0x87000000
20#define CONFIG_SYS_MALLOC_LEN SZ_256M
21#define CONFIG_SYS_BOOTM_LEN SZ_256M
22
23#ifdef CONFIG_SPL
24#define CONFIG_SPL_MAX_SIZE 0x00100000
25#define CONFIG_SPL_BSS_START_ADDR 0x82000000
26#define CONFIG_SPL_BSS_MAX_SIZE 0x00100000
27#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \
28 CONFIG_SPL_BSS_MAX_SIZE)
29#define CONFIG_SYS_SPL_MALLOC_SIZE 0x0100000
30#define CONFIG_SPL_STACK (0x80000000 + 0x04000000 - \
31 GENERATED_GBL_DATA_SIZE)
32
33#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "boot/fw_payload.bin"
34#define CONFIG_SPL_GD_ADDR 0x85000000
35#endif
36
37/* -------------------------------------------------
38 * Environment
39 */
40//Disable persistent environment variable storage
41#define CONFIG_ENV_IS_NOWHERE 1
42
43/* ---------------------------------------------------------------------
44 * Board boot configuration
45 */
46
47#define CONFIG_EXTRA_ENV_SETTINGS \
48 "fdt_addr_r=0x86000000\0" \
49 "kernel_addr_r=0x80200000\0" \
50 "image=boot/Image\0" \
51 "mmcdev=0\0" \
52 "mmcpart=1\0"
53
54#define CONFIG_USE_BOOTCOMMAND
55#define CONFIG_BOOTCOMMAND \
56 "fdt addr ${fdtcontroladdr}; " \
57 "fdt move ${fdtcontroladdr} ${fdt_addr_r}; " \
58 "load mmc ${mmcdev}:${mmcpart} ${kernel_addr_r} ${image}; " \
59 "booti ${kernel_addr_r} - ${fdt_addr_r}; "
60
61#endif/* __CONFIG_H */