Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ |
| 2 | /* |
| 3 | * Copyright (c) 2018 Microsemi Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef __VCOREIII_H |
| 7 | #define __VCOREIII_H |
| 8 | |
| 9 | #include <linux/sizes.h> |
| 10 | |
| 11 | /* Onboard devices */ |
| 12 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 13 | #define CFG_SYS_INIT_SP_OFFSET 0x400000 |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 14 | |
Tom Rini | df6a215 | 2022-11-16 13:10:28 -0500 | [diff] [blame] | 15 | #define CFG_SYS_NS16550_CLK CONFIG_SYS_MIPS_TIMER_FREQ |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 16 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 17 | #define CFG_SYS_SDRAM_BASE 0x80000000 |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 18 | #if defined(CONFIG_DDRTYPE_H5TQ1G63BFA) || defined(CONFIG_DDRTYPE_MT47H128M8HQ) |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 19 | #define CFG_SYS_SDRAM_SIZE (128 * SZ_1M) |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 20 | #elif defined(CONFIG_DDRTYPE_MT41J128M16HA) || defined(CONFIG_DDRTYPE_MT41K128M16JT) |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 21 | #define CFG_SYS_SDRAM_SIZE (256 * SZ_1M) |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 22 | #elif defined(CONFIG_DDRTYPE_H5TQ4G63MFR) || defined(CONFIG_DDRTYPE_MT41K256M16) |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 23 | #define CFG_SYS_SDRAM_SIZE (512 * SZ_1M) |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 24 | #else |
| 25 | #error Unknown DDR size - please add! |
| 26 | #endif |
| 27 | |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 28 | #define CFG_EXTRA_ENV_SETTINGS \ |
Gregory CLEMENT | b622f8f | 2018-12-14 16:16:49 +0100 | [diff] [blame] | 29 | "loadaddr=0x81000000\0" \ |
| 30 | "spi_image_off=0x00100000\0" \ |
| 31 | "console=ttyS0,115200\0" \ |
| 32 | "setup=setenv bootargs console=${console} ${mtdparts}" \ |
| 33 | "${bootargs_extra}\0" \ |
| 34 | "spiboot=run setup; sf probe; sf read ${loadaddr}" \ |
| 35 | "${spi_image_off} 0x600000; bootm ${loadaddr}\0" \ |
| 36 | "ubootfile=u-boot.bin\0" \ |
| 37 | "update=sf probe;mtdparts;dhcp ${loadaddr} ${ubootfile};" \ |
| 38 | "sf erase UBoot 0x100000;" \ |
| 39 | "sf write ${loadaddr} UBoot ${filesize}\0" \ |
| 40 | "bootcmd=run spiboot\0" \ |
| 41 | "" |
| 42 | #endif /* __VCOREIII_H */ |