2018-05-06 17:58:06 -04:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-09-08 14:08:45 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Altera Corporation <www.altera.com>
|
|
|
|
*/
|
2015-12-03 16:05:59 -06:00
|
|
|
#ifndef __CONFIG_SOCFPGA_COMMON_H__
|
|
|
|
#define __CONFIG_SOCFPGA_COMMON_H__
|
2014-09-08 14:08:45 +02:00
|
|
|
|
2020-05-10 11:40:09 -06:00
|
|
|
#include <linux/stringify.h>
|
|
|
|
|
2014-09-08 14:08:45 +02:00
|
|
|
/*
|
|
|
|
* Memory configurations
|
|
|
|
*/
|
|
|
|
#define PHYS_SDRAM_1 0x0
|
2017-04-26 02:44:46 +08:00
|
|
|
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
2022-11-16 13:10:41 -05:00
|
|
|
#define CFG_SYS_INIT_RAM_ADDR 0xFFFF0000
|
|
|
|
#define CFG_SYS_INIT_RAM_SIZE SOCFPGA_PHYS_OCRAM_SIZE
|
2017-04-26 02:44:46 +08:00
|
|
|
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
2022-11-16 13:10:41 -05:00
|
|
|
#define CFG_SYS_INIT_RAM_ADDR 0xFFE00000
|
2019-04-09 21:02:04 +02:00
|
|
|
/* SPL memory allocation configuration, this is for FAT implementation */
|
2022-11-16 13:10:41 -05:00
|
|
|
#define CFG_SYS_INIT_RAM_SIZE (SOCFPGA_PHYS_OCRAM_SIZE - \
|
2023-09-26 08:14:16 -06:00
|
|
|
CONFIG_SPL_SYS_MALLOC_SIZE)
|
2017-04-26 02:44:46 +08:00
|
|
|
#endif
|
2018-10-30 10:00:22 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Some boards (e.g. socfpga_sr1500) use 8 bytes at the end of the internal
|
|
|
|
* SRAM as bootcounter storage. Make sure to not put the stack directly
|
|
|
|
* at this address to not overwrite the bootcounter by checking, if the
|
|
|
|
* bootcounter address is located in the internal SRAM.
|
|
|
|
*/
|
2022-11-16 13:10:41 -05:00
|
|
|
#if ((CONFIG_SYS_BOOTCOUNT_ADDR > CFG_SYS_INIT_RAM_ADDR) && \
|
|
|
|
(CONFIG_SYS_BOOTCOUNT_ADDR < (CFG_SYS_INIT_RAM_ADDR + \
|
|
|
|
CFG_SYS_INIT_RAM_SIZE)))
|
2018-10-30 10:00:22 +01:00
|
|
|
#endif
|
2014-09-08 14:08:45 +02:00
|
|
|
|
2019-04-09 21:02:04 +02:00
|
|
|
/*
|
|
|
|
* U-Boot stack setup: if SPL post-reloc uses DDR stack, use it in pre-reloc
|
|
|
|
* phase of U-Boot, too. This prevents overwriting SPL data if stack/heap usage
|
|
|
|
* in U-Boot pre-reloc is higher than in SPL.
|
|
|
|
*/
|
|
|
|
|
2022-11-16 13:10:37 -05:00
|
|
|
#define CFG_SYS_SDRAM_BASE PHYS_SDRAM_1
|
2014-09-08 14:08:45 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* U-Boot general configurations
|
|
|
|
*/
|
|
|
|
/* Print buffer size */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cache
|
|
|
|
*/
|
2022-11-16 13:10:41 -05:00
|
|
|
#define CFG_SYS_PL310_BASE SOCFPGA_MPUL2_ADDRESS
|
2014-09-08 14:08:45 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* L4 OSC1 Timer 0
|
|
|
|
*/
|
2018-08-18 16:00:31 +02:00
|
|
|
#ifndef CONFIG_TIMER
|
2022-11-16 13:10:41 -05:00
|
|
|
#define CFG_SYS_TIMERBASE SOCFPGA_OSC1TIMER0_ADDRESS
|
|
|
|
#define CFG_SYS_TIMER_COUNTER (CFG_SYS_TIMERBASE + 0x4)
|
|
|
|
#ifndef CFG_SYS_TIMER_RATE
|
|
|
|
#define CFG_SYS_TIMER_RATE 25000000
|
2018-08-18 16:00:31 +02:00
|
|
|
#endif
|
2020-02-15 14:10:02 +01:00
|
|
|
#endif
|
2014-09-08 14:08:45 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* L4 Watchdog
|
|
|
|
*/
|
2022-12-04 10:03:39 -05:00
|
|
|
#define CFG_DW_WDT_CLOCK_KHZ 25000
|
2014-09-08 14:08:45 +02:00
|
|
|
|
2015-12-20 04:00:46 +01:00
|
|
|
/*
|
|
|
|
* NAND Support
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_NAND_DENALI
|
2022-11-12 17:36:51 -05:00
|
|
|
#define CFG_SYS_NAND_REGS_BASE SOCFPGA_NANDREGS_ADDRESS
|
|
|
|
#define CFG_SYS_NAND_DATA_BASE SOCFPGA_NANDDATA_ADDRESS
|
2015-12-20 04:00:46 +01:00
|
|
|
#endif
|
|
|
|
|
2014-10-24 23:34:25 +02:00
|
|
|
/*
|
|
|
|
* USB
|
|
|
|
*/
|
|
|
|
|
2014-11-04 04:25:09 +01:00
|
|
|
/*
|
|
|
|
* USB Gadget (DFU, UMS)
|
|
|
|
*/
|
|
|
|
#if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
|
|
|
|
#define DFU_DEFAULT_POLL_TIMEOUT 300
|
|
|
|
#endif
|
|
|
|
|
2014-09-08 14:08:45 +02:00
|
|
|
/*
|
|
|
|
* U-Boot environment
|
|
|
|
*/
|
|
|
|
|
2015-12-21 21:02:45 +08:00
|
|
|
/* Environment for SDMMC boot */
|
|
|
|
|
2016-02-24 16:50:22 +08:00
|
|
|
/* Environment for QSPI boot */
|
|
|
|
|
2014-09-08 14:08:45 +02:00
|
|
|
/*
|
|
|
|
* SPL
|
2014-10-16 12:25:40 +02:00
|
|
|
*
|
2017-12-05 15:58:04 +08:00
|
|
|
* SRAM Memory layout for gen 5:
|
2014-10-16 12:25:40 +02:00
|
|
|
*
|
|
|
|
* 0xFFFF_0000 ...... Start of SRAM
|
|
|
|
* 0xFFFF_xxxx ...... Top of stack (grows down)
|
2019-04-09 21:02:03 +02:00
|
|
|
* 0xFFFF_yyyy ...... Global Data
|
|
|
|
* 0xFFFF_zzzz ...... Malloc area
|
|
|
|
* 0xFFFF_FFFF ...... End of SRAM
|
2017-12-05 15:58:04 +08:00
|
|
|
*
|
|
|
|
* SRAM Memory layout for Arria 10:
|
|
|
|
* 0xFFE0_0000 ...... Start of SRAM (bottom)
|
|
|
|
* 0xFFEx_xxxx ...... Top of stack (grows down to bottom)
|
|
|
|
* 0xFFEy_yyyy ...... Global Data
|
|
|
|
* 0xFFEz_zzzz ...... Malloc area (grows up to top)
|
|
|
|
* 0xFFE3_FFFF ...... End of SRAM (top)
|
2014-09-08 14:08:45 +02:00
|
|
|
*/
|
|
|
|
|
2015-07-21 07:50:03 +02:00
|
|
|
/* SPL QSPI boot support */
|
|
|
|
|
2015-12-20 04:00:46 +01:00
|
|
|
/* SPL NAND boot support */
|
|
|
|
|
2017-04-13 07:30:29 -07:00
|
|
|
/* Extra Environment */
|
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
|
|
|
2018-01-25 07:18:27 +01:00
|
|
|
#ifdef CONFIG_CMD_DHCP
|
|
|
|
#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
|
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICES_DHCP(func)
|
|
|
|
#endif
|
|
|
|
|
2018-04-13 15:26:40 -05:00
|
|
|
#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
|
2017-04-13 07:30:29 -07:00
|
|
|
#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
|
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICES_PXE(func)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CMD_MMC
|
|
|
|
#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
|
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICES_MMC(func)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BOOT_TARGET_DEVICES(func) \
|
|
|
|
BOOT_TARGET_DEVICES_MMC(func) \
|
|
|
|
BOOT_TARGET_DEVICES_PXE(func) \
|
2018-01-25 07:18:27 +01:00
|
|
|
BOOT_TARGET_DEVICES_DHCP(func)
|
2017-04-13 07:30:29 -07:00
|
|
|
|
|
|
|
#include <config_distro_bootcmd.h>
|
|
|
|
|
2022-12-04 10:03:50 -05:00
|
|
|
#ifndef CFG_EXTRA_ENV_SETTINGS
|
|
|
|
#define CFG_EXTRA_ENV_SETTINGS \
|
2017-04-13 07:30:29 -07:00
|
|
|
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
|
|
|
|
"bootm_size=0xa000000\0" \
|
|
|
|
"kernel_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0" \
|
|
|
|
"fdt_addr_r=0x02000000\0" \
|
|
|
|
"scriptaddr=0x02100000\0" \
|
|
|
|
"pxefile_addr_r=0x02200000\0" \
|
|
|
|
"ramdisk_addr_r=0x02300000\0" \
|
2019-03-01 20:12:31 +01:00
|
|
|
"socfpga_legacy_reset_compat=1\0" \
|
2017-04-13 07:30:29 -07:00
|
|
|
BOOTENV
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2015-12-03 16:05:59 -06:00
|
|
|
#endif /* __CONFIG_SOCFPGA_COMMON_H__ */
|