2018-05-07 06:58:06 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2007-03-11 21:42:58 +09:00
|
|
|
/*
|
2010-08-02 21:20:28 +09:00
|
|
|
* (C) Copyright 2007-2010 Michal Simek
|
2007-03-11 21:42:58 +09:00
|
|
|
*
|
2007-09-24 07:30:42 +09:00
|
|
|
* Michal SIMEK <monstr@monstr.eu>
|
2007-03-11 21:42:58 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONFIG_H
|
|
|
|
#define __CONFIG_H
|
|
|
|
|
2008-12-19 21:14:05 +09:00
|
|
|
#include "../board/xilinx/microblaze-generic/xparameters.h"
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2010-08-02 21:20:28 +09:00
|
|
|
/* MicroBlaze CPU */
|
2007-05-08 21:52:52 +09:00
|
|
|
#define MICROBLAZE_V5 1
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2012-07-29 07:25:36 +09:00
|
|
|
/* linear and spi flash memory */
|
2012-06-27 07:28:25 +09:00
|
|
|
#ifdef XILINX_FLASH_START
|
|
|
|
#define FLASH
|
2012-07-29 07:25:36 +09:00
|
|
|
#undef SPIFLASH
|
2012-06-27 07:28:25 +09:00
|
|
|
#undef RAMENV /* hold environment in flash */
|
|
|
|
#else
|
2012-07-29 07:25:36 +09:00
|
|
|
#undef FLASH
|
|
|
|
#undef SPIFLASH
|
2012-06-27 07:28:25 +09:00
|
|
|
#define RAMENV /* hold environment in RAM */
|
|
|
|
#endif
|
|
|
|
|
2007-03-11 21:42:58 +09:00
|
|
|
/* uart */
|
2015-12-09 20:42:16 +09:00
|
|
|
/* The following table includes the supported baudrates */
|
|
|
|
# define CONFIG_SYS_BAUDRATE_TABLE \
|
|
|
|
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
|
|
|
|
|
2007-03-11 21:42:58 +09:00
|
|
|
/* setting reset address */
|
2010-10-08 04:51:12 +09:00
|
|
|
/*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2014-05-08 23:08:44 +09:00
|
|
|
#define CONFIG_SYS_MALLOC_LEN 0xC0000
|
|
|
|
|
|
|
|
/* Stack location before relocation */
|
2015-12-08 22:34:13 +09:00
|
|
|
#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
|
|
|
|
CONFIG_SYS_MALLOC_F_LEN)
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2012-07-01 23:44:37 +09:00
|
|
|
/*
|
|
|
|
* CFI flash memory layout - Example
|
|
|
|
* CONFIG_SYS_FLASH_BASE = 0x2200_0000;
|
|
|
|
* CONFIG_SYS_FLASH_SIZE = 0x0080_0000; 8MB
|
|
|
|
*
|
|
|
|
* SECT_SIZE = 0x20000; 128kB is one sector
|
|
|
|
* CONFIG_ENV_SIZE = SECT_SIZE; 128kB environment store
|
|
|
|
*
|
|
|
|
* 0x2200_0000 CONFIG_SYS_FLASH_BASE
|
|
|
|
* FREE 256kB
|
|
|
|
* 0x2204_0000 CONFIG_ENV_ADDR
|
|
|
|
* ENV_AREA 128kB
|
|
|
|
* 0x2206_0000
|
|
|
|
* FREE
|
|
|
|
* 0x2280_0000 CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-03-11 21:42:58 +09:00
|
|
|
#ifdef FLASH
|
2010-08-02 21:20:28 +09:00
|
|
|
# define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START
|
|
|
|
# define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE
|
|
|
|
/* ?empty sector */
|
|
|
|
# define CONFIG_SYS_FLASH_EMPTY_INFO 1
|
|
|
|
/* max number of memory banks */
|
|
|
|
# define CONFIG_SYS_MAX_FLASH_BANKS 1
|
|
|
|
/* max number of sectors on one chip */
|
|
|
|
# define CONFIG_SYS_MAX_FLASH_SECT 512
|
|
|
|
/* hardware flash protection */
|
2014-01-21 15:26:58 +09:00
|
|
|
/* use buffered writes (20x faster) */
|
2010-08-02 21:20:28 +09:00
|
|
|
# ifdef RAMENV
|
|
|
|
# define CONFIG_ENV_SIZE 0x1000
|
|
|
|
# define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
|
|
|
|
|
2012-07-29 07:25:36 +09:00
|
|
|
# else /* FLASH && !RAMENV */
|
2010-08-02 21:20:28 +09:00
|
|
|
/* 128K(one sector) for env */
|
|
|
|
# define CONFIG_ENV_SECT_SIZE 0x20000
|
|
|
|
# define CONFIG_ENV_ADDR \
|
|
|
|
(CONFIG_SYS_FLASH_BASE + (2 * CONFIG_ENV_SECT_SIZE))
|
|
|
|
# define CONFIG_ENV_SIZE 0x20000
|
2012-07-29 07:25:36 +09:00
|
|
|
# endif /* FLASH && !RAMBOOT */
|
2007-03-11 21:42:58 +09:00
|
|
|
#else /* !FLASH */
|
2012-07-29 07:25:36 +09:00
|
|
|
|
|
|
|
#ifdef SPIFLASH
|
|
|
|
# ifdef RAMENV
|
|
|
|
# define CONFIG_ENV_SIZE 0x1000
|
|
|
|
# define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
|
|
|
|
|
|
|
|
# else /* SPIFLASH && !RAMENV */
|
|
|
|
/* 128K(two sectors) for env */
|
|
|
|
# define CONFIG_ENV_SECT_SIZE 0x10000
|
|
|
|
# define CONFIG_ENV_SIZE (2 * CONFIG_ENV_SECT_SIZE)
|
|
|
|
/* Warning: adjust the offset in respect of other flash content and size */
|
|
|
|
# define CONFIG_ENV_OFFSET (128 * CONFIG_ENV_SECT_SIZE) /* at 8MB */
|
|
|
|
# endif /* SPIFLASH && !RAMBOOT */
|
|
|
|
#else /* !SPIFLASH */
|
|
|
|
|
2010-08-02 21:20:28 +09:00
|
|
|
/* ENV in RAM */
|
|
|
|
# define CONFIG_ENV_SIZE 0x1000
|
|
|
|
# define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
|
2012-07-29 07:25:36 +09:00
|
|
|
#endif /* !SPIFLASH */
|
2007-03-11 21:42:58 +09:00
|
|
|
#endif /* !FLASH */
|
|
|
|
|
2009-01-05 21:29:32 +09:00
|
|
|
#if defined(XILINX_USE_ICACHE)
|
2010-08-02 21:20:28 +09:00
|
|
|
# define CONFIG_ICACHE
|
2009-01-05 21:29:32 +09:00
|
|
|
#else
|
2010-08-02 21:20:28 +09:00
|
|
|
# undef CONFIG_ICACHE
|
2009-01-05 21:29:32 +09:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(XILINX_USE_DCACHE)
|
2010-08-02 21:20:28 +09:00
|
|
|
# define CONFIG_DCACHE
|
2009-01-05 21:29:32 +09:00
|
|
|
#else
|
2010-08-02 21:20:28 +09:00
|
|
|
# undef CONFIG_DCACHE
|
2009-01-05 21:29:32 +09:00
|
|
|
#endif
|
|
|
|
|
2012-09-25 17:13:35 +09:00
|
|
|
#ifndef XILINX_DCACHE_BYTE_SIZE
|
|
|
|
#define XILINX_DCACHE_BYTE_SIZE 32768
|
|
|
|
#endif
|
|
|
|
|
2007-07-11 00:12:10 +09:00
|
|
|
/*
|
|
|
|
* BOOTP options
|
|
|
|
*/
|
|
|
|
#define CONFIG_BOOTP_BOOTFILESIZE
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2012-06-27 07:28:26 +09:00
|
|
|
#if defined(CONFIG_MTD_PARTITIONS)
|
|
|
|
/* MTD partitions */
|
2007-04-25 06:01:02 +09:00
|
|
|
|
|
|
|
/* default mtd partition table */
|
|
|
|
#endif
|
|
|
|
|
2010-08-02 21:20:28 +09:00
|
|
|
/* size of console buffer */
|
|
|
|
#define CONFIG_SYS_CBSIZE 512
|
|
|
|
/* max number of command args */
|
|
|
|
#define CONFIG_SYS_MAXARGS 15
|
|
|
|
/* default load address */
|
2015-12-11 22:45:29 +09:00
|
|
|
#define CONFIG_SYS_LOAD_ADDR 0
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2018-03-28 21:38:20 +09:00
|
|
|
#define CONFIG_HOSTNAME "microblaze-generic"
|
2007-09-24 07:41:30 +09:00
|
|
|
#define CONFIG_BOOTCOMMAND "base 0;tftp 11000000 image.img;bootm"
|
2007-03-11 21:42:58 +09:00
|
|
|
|
|
|
|
/* architecture dependent code */
|
2008-10-16 22:01:15 +09:00
|
|
|
#define CONFIG_SYS_USR_EXCEP /* user exception */
|
2007-03-11 21:42:58 +09:00
|
|
|
|
2016-05-10 20:11:19 +09:00
|
|
|
#ifndef CONFIG_EXTRA_ENV_SETTINGS
|
2010-08-02 21:20:28 +09:00
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" \
|
2010-06-22 05:58:10 +09:00
|
|
|
"nor0=flash-0\0"\
|
|
|
|
"mtdparts=mtdparts=flash-0:"\
|
2007-04-25 06:01:02 +09:00
|
|
|
"256k(u-boot),256k(env),3m(kernel),"\
|
2010-06-10 22:46:04 +09:00
|
|
|
"1m(romfs),1m(cramfs),-(jffs2)\0"\
|
|
|
|
"nc=setenv stdout nc;"\
|
|
|
|
"setenv stdin nc\0" \
|
|
|
|
"serial=setenv stdout serial;"\
|
|
|
|
"setenv stdin serial\0"
|
2016-05-10 20:11:19 +09:00
|
|
|
#endif
|
2007-04-25 06:01:02 +09:00
|
|
|
|
2015-12-03 01:22:07 +09:00
|
|
|
#if defined(CONFIG_XILINX_AXIEMAC)
|
2012-02-25 02:33:41 +09:00
|
|
|
# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1
|
|
|
|
#endif
|
|
|
|
|
2014-01-21 15:30:37 +09:00
|
|
|
/* SPL part */
|
|
|
|
|
2015-01-27 22:25:38 +09:00
|
|
|
#ifdef CONFIG_SYS_FLASH_BASE
|
|
|
|
# define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_FLASH_BASE
|
|
|
|
#endif
|
2014-01-21 15:30:37 +09:00
|
|
|
|
|
|
|
/* for booting directly linux */
|
|
|
|
|
|
|
|
#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \
|
|
|
|
0x40000)
|
2018-07-15 06:04:35 +09:00
|
|
|
#define CONFIG_SYS_FDT_SIZE (16 << 10)
|
2014-01-21 15:30:37 +09:00
|
|
|
#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
|
|
|
|
0x1000000)
|
|
|
|
|
|
|
|
/* SP location before relocation, must use scratch RAM */
|
|
|
|
/* BRAM start */
|
|
|
|
#define CONFIG_SYS_INIT_RAM_ADDR 0x0
|
|
|
|
/* BRAM size - will be generated */
|
2015-02-04 00:24:48 +09:00
|
|
|
#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
|
2014-01-21 15:30:37 +09:00
|
|
|
|
2015-02-04 00:24:48 +09:00
|
|
|
# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
|
|
|
|
CONFIG_SYS_INIT_RAM_SIZE - \
|
|
|
|
CONFIG_SYS_MALLOC_F_LEN)
|
2014-01-21 15:30:37 +09:00
|
|
|
|
|
|
|
/* Just for sure that there is a space for stack */
|
|
|
|
#define CONFIG_SPL_STACK_SIZE 0x100
|
|
|
|
|
|
|
|
#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
|
|
|
|
|
|
|
|
#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
|
|
|
|
CONFIG_SYS_INIT_RAM_ADDR - \
|
2015-02-04 00:24:48 +09:00
|
|
|
CONFIG_SYS_MALLOC_F_LEN - \
|
2014-01-21 15:30:37 +09:00
|
|
|
CONFIG_SPL_STACK_SIZE)
|
|
|
|
|
2007-03-11 21:42:58 +09:00
|
|
|
#endif /* __CONFIG_H */
|