Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Andes Technology Corporation |
| 4 | * Rick Chen, Andes Technology Corporation <rick@andestech.com> |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_H |
| 8 | #define __CONFIG_H |
| 9 | |
Pragnesh Patel | 02038c3 | 2021-01-17 18:11:25 +0530 | [diff] [blame] | 10 | #define RISCV_MMODE_TIMERBASE 0xe6000000 |
| 11 | #define RISCV_MMODE_TIMER_FREQ 60000000 |
| 12 | |
| 13 | #define RISCV_SMODE_TIMER_FREQ 60000000 |
| 14 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 15 | /* |
| 16 | * CPU and Board Configuration Options |
| 17 | */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 18 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 19 | /* |
| 20 | * Miscellaneous configurable options |
| 21 | */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 22 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 23 | /* |
| 24 | * Physical Memory Map |
| 25 | */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 26 | #define PHYS_SDRAM_0 0x00000000 /* SDRAM Bank #1 */ |
| 27 | #define PHYS_SDRAM_1 \ |
| 28 | (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) /* SDRAM Bank #2 */ |
| 29 | #define PHYS_SDRAM_0_SIZE 0x20000000 /* 512 MB */ |
| 30 | #define PHYS_SDRAM_1_SIZE 0x20000000 /* 512 MB */ |
| 31 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 |
| 32 | |
| 33 | /* |
| 34 | * Serial console configuration |
| 35 | */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 36 | #define CONFIG_SYS_NS16550_SERIAL |
| 37 | #ifndef CONFIG_DM_SERIAL |
| 38 | #define CONFIG_SYS_NS16550_REG_SIZE -4 |
| 39 | #endif |
| 40 | #define CONFIG_SYS_NS16550_CLK 19660800 |
| 41 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 42 | /* Init Stack Pointer */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 43 | |
Rick Chen | c616414 | 2018-05-29 11:04:23 +0800 | [diff] [blame] | 44 | /* support JEDEC */ |
Rick Chen | c616414 | 2018-05-29 11:04:23 +0800 | [diff] [blame] | 45 | #define PHYS_FLASH_1 0x88000000 /* BANK 0 */ |
| 46 | #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1 |
| 47 | #define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, } |
Rick Chen | c616414 | 2018-05-29 11:04:23 +0800 | [diff] [blame] | 48 | |
| 49 | #define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* TO for Flash Erase (ms) */ |
| 50 | #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* TO for Flash Write (ms) */ |
| 51 | |
| 52 | /* max number of memory banks */ |
| 53 | /* |
| 54 | * There are 4 banks supported for this Controller, |
| 55 | * but we have only 1 bank connected to flash on board |
| 56 | */ |
Rick Chen | c616414 | 2018-05-29 11:04:23 +0800 | [diff] [blame] | 57 | #define CONFIG_SYS_FLASH_BANKS_SIZES {0x4000000} |
| 58 | |
| 59 | /* max number of sectors on one chip */ |
| 60 | #define CONFIG_FLASH_SECTOR_SIZE (0x10000*2) |
| 61 | #define CONFIG_SYS_MAX_FLASH_SECT 512 |
| 62 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 63 | /* environments */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 64 | |
| 65 | /* SPI FLASH */ |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 66 | |
| 67 | /* |
| 68 | * For booting Linux, the board info and command line data |
| 69 | * have to be in the first 16 MB of memory, since this is |
| 70 | * the maximum mapped by the Linux kernel during initialization. |
| 71 | */ |
| 72 | |
| 73 | /* Initial Memory map for Linux*/ |
| 74 | #define CONFIG_SYS_BOOTMAPSZ (64 << 20) |
| 75 | /* Increase max gunzip size */ |
| 76 | #define CONFIG_SYS_BOOTM_LEN (64 << 20) |
| 77 | |
Leo Yu-Chi Liang | 919a0e7 | 2021-11-04 09:53:26 +0800 | [diff] [blame] | 78 | /* Support autoboot from RAM (kernel image is loaded via debug port) */ |
| 79 | #define KERNEL_IMAGE_ADDR "0x2000000 " |
| 80 | #define BOOTENV_DEV_NAME_RAM(devtypeu, devtypel, instance) \ |
| 81 | "ram " |
| 82 | #define BOOTENV_DEV_RAM(devtypeu, devtypel, instance) \ |
| 83 | "bootcmd_ram=" \ |
| 84 | "booti " \ |
| 85 | KERNEL_IMAGE_ADDR \ |
| 86 | "- $fdtcontroladdr\0" |
| 87 | |
Alexander Graf | 438b9be | 2018-04-23 07:59:49 +0200 | [diff] [blame] | 88 | /* When we use RAM as ENV */ |
Alexander Graf | 438b9be | 2018-04-23 07:59:49 +0200 | [diff] [blame] | 89 | |
| 90 | /* Enable distro boot */ |
| 91 | #define BOOT_TARGET_DEVICES(func) \ |
| 92 | func(MMC, mmc, 0) \ |
Leo Yu-Chi Liang | 919a0e7 | 2021-11-04 09:53:26 +0800 | [diff] [blame] | 93 | func(DHCP, dhcp, na) \ |
| 94 | func(RAM, ram, na) |
Alexander Graf | 438b9be | 2018-04-23 07:59:49 +0200 | [diff] [blame] | 95 | #include <config_distro_bootcmd.h> |
| 96 | |
| 97 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 98 | "kernel_addr_r=0x00080000\0" \ |
| 99 | "pxefile_addr_r=0x01f00000\0" \ |
| 100 | "scriptaddr=0x01f00000\0" \ |
| 101 | "fdt_addr_r=0x02000000\0" \ |
| 102 | "ramdisk_addr_r=0x02800000\0" \ |
| 103 | BOOTENV |
| 104 | |
Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 105 | #endif /* __CONFIG_H */ |