elphel393.h 5.96 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * (C) Copyright 2012 Xilinx
 * (C) Copyright 2013 Elphel
 *
 * Configuration for Elphel393 Board
 * See zynq_common.h for Zynq common configs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef __CONFIG_ELPHEL393_H
#define __CONFIG_ELPHEL393_H

22
#define CONFIG_SYS_SDRAM_SIZE (1024 * 1024 * 1024)
23

24
#define CONFIG_ZYNQ_SERIAL_UART0
25
#define CONFIG_ZYNQ_GEM0
26 27
#define CONFIG_ZYNQ_GEM_PHY_ADDR0	0

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
28 29 30
#define CONFIG_ZYNQ_SDHCI0

#define CONFIG_SYS_NO_FLASH
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
31

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
32
#define CONFIG_NAND_ZYNQ
33

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
34 35 36 37 38 39 40 41 42
#ifdef CONFIG_NAND_ZYNQ
    #define CONFIG_CMD_NAND
    #define CONFIG_CMD_NAND_LOCK_UNLOCK
    #define CONFIG_SYS_MAX_NAND_DEVICE 1
    #define CONFIG_SYS_NAND_SELF_INIT
    #define CONFIG_SYS_NAND_ONFI_DETECTION
    #define CONFIG_MTD_DEVICE
#endif

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
43 44 45 46 47
/*
#define CONFIG_SPL_NAND_SUPPORT
#define CONFIG_SPL_NAND_DRIVERS
*/

48
/*#define CONFIG_DEFAULT_DEVICE_TREE	elphel393*/
49

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
50 51 52
/*redefined in zynq-common.h*/
#undef CONFIG_CMD_NAND

53 54 55 56
#include <configs/zynq-common.h>
#undef CONFIG_SYS_PROMPT
#undef CONFIG_BOOTDELAY
#undef CONFIG_EXTRA_ENV_SETTINGS
57 58
/*skip u-boot falcon mode*/
#undef CONFIG_SPL_OS_BOOT
59

60 61
#include <configs/ezynq/ezynq_MT41K256M16HA107.h>  /* should be before zed_ezynq.h as it overwrites DDR3L with DDR3 */
#include <configs/ezynq/ezynq_XC7Z030_1FBG484C.h>
62
#include <configs/ezynq/ezynq_elphel393.h>
63

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
64 65 66 67 68 69 70 71
/*#define CONFIG_SYS_MAX_NAND_DEVICE	1*/
/*#define CONFIG_SYS_NAND_BASE		0xE1000000*/
/*
#define CONFIG_SPL_NAND_DENALI
#define CONFIG_SYS_NAND_DATA_BASE	0xE1000000
#define CONFIG_SYS_NAND_REGS_BASE	0xE1000000
#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
*/
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
72
/*
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
73
#define CONFIG_SYS_NAND_U_BOOT_OFFS	0xE1000000
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
74
*/
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
75

76 77
#define CONFIG_CMD_MEMTEST

78
#define CONFIG_BOOTDELAY	1 /* -1 to Disable autoboot */
79
#define CONFIG_SYS_PROMPT		"elphel393-u-boot> "
80

81
/*#define CONFIG_EZYNQ_SKIP_DDR*/
82 83
#define CONFIG_EZYNQ_SKIP_CLK

84
/* Default environment */
85 86 87 88 89 90
#define CONFIG_EXTRA_ENV_SETTINGS	\
	"ethaddr=00:0a:35:00:01:22\0"	\
	"kernel_image=uImage\0"	\
	"ramdisk_image=uramdisk.image.gz\0"	\
	"devicetree_image=devicetree.dtb\0"	\
	"bitstream_image=system.bit.bin\0"	\
91
	"boot_image=BOOT.bin\0"	\
92
	"loadbit_addr=0x100000\0"	\
93
	"loadbootenv_addr=0x2000000\0" \
94 95 96
	"kernel_size=0x500000\0"	\
	"devicetree_size=0x20000\0"	\
	"ramdisk_size=0x5E0000\0"	\
97
	"boot_size=0xF00000\0"	\
98
	"fdt_high=0x20000000\0"	\
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
99
	"initrd_high=0x20000000\0"	\
100 101 102 103
	"bootenv=uEnv.txt\0" \
	"loadbootenv=fatload mmc 0 ${loadbootenv_addr} ${bootenv}\0" \
	"importbootenv=echo Importing environment from SD ...; " \
		"env import -t ${loadbootenv_addr} $filesize\0" \
104 105 106 107
	"mmc_loadbit_fat=echo Loading bitstream from SD/MMC/eMMC to RAM.. && " \
		"mmcinfo && " \
		"fatload mmc 0 ${loadbit_addr} ${bitstream_image} && " \
		"fpga load 0 ${loadbit_addr} ${filesize}\0" \
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
	"norboot=echo Copying Linux from NOR flash to RAM... && " \
		"cp.b 0xE2100000 0x3000000 ${kernel_size} && " \
		"cp.b 0xE2600000 0x2A00000 ${devicetree_size} && " \
		"echo Copying ramdisk... && " \
		"cp.b 0xE2620000 0x2000000 ${ramdisk_size} && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"qspiboot=echo Copying Linux from QSPI flash to RAM... && " \
		"sf probe 0 0 0 && " \
		"sf read 0x3000000 0x100000 ${kernel_size} && " \
		"sf read 0x2A00000 0x600000 ${devicetree_size} && " \
		"echo Copying ramdisk... && " \
		"sf read 0x2000000 0x620000 ${ramdisk_size} && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"uenvboot=" \
		"if run loadbootenv; then " \
			"echo Loaded environment from ${bootenv}; " \
			"run importbootenv; " \
		"fi; " \
		"if test -n $uenvcmd; then " \
			"echo Running uenvcmd ...; " \
			"run uenvcmd; " \
		"fi\0" \
	"sdboot=if mmcinfo; then " \
			"run uenvboot; " \
			"echo Copying Linux from SD to RAM... && " \
			"fatload mmc 0 0x3F00000 ${kernel_image} && " \
			"fatload mmc 0 0x3E00000 ${devicetree_image} && " \
			"fatload mmc 0 0x2000000 ${ramdisk_image} && " \
			"bootm 0x3F00000 0x2000000 0x3E00000; " \
		"fi\0" \
	"usbboot=if usb start; then " \
			"run uenvboot; " \
			"echo Copying Linux from USB to RAM... && " \
			"fatload usb 0 0x3000000 ${kernel_image} && " \
			"fatload usb 0 0x2A00000 ${devicetree_image} && " \
			"fatload usb 0 0x2000000 ${ramdisk_image} && " \
			"bootm 0x3000000 0x2000000 0x2A00000; " \
		"fi\0" \
146 147 148 149 150
	"nandboot=echo Copying Linux from NAND flash to RAM... && " \
		"nand read 0x3000000 0x100000 ${kernel_size} && " \
		"nand read 0x2A00000 0x600000 ${devicetree_size} && " \
		"echo Copying ramdisk... && " \
		"nand read 0x2000000 0x620000 ${ramdisk_size} && " \
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"jtagboot=echo TFTPing Linux to RAM... && " \
		"tftpboot 0x3000000 ${kernel_image} && " \
		"tftpboot 0x2A00000 ${devicetree_image} && " \
		"tftpboot 0x2000000 ${ramdisk_image} && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"rsa_norboot=echo Copying Image from NOR flash to RAM... && " \
		"cp.b 0xE2100000 0x100000 ${boot_size} && " \
		"zynqrsa 0x100000 && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"rsa_nandboot=echo Copying Image from NAND flash to RAM... && " \
		"nand read 0x100000 0x0 ${boot_size} && " \
		"zynqrsa 0x100000 && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"rsa_qspiboot=echo Copying Image from QSPI flash to RAM... && " \
		"sf probe 0 0 0 && " \
		"sf read 0x100000 0x0 ${boot_size} && " \
		"zynqrsa 0x100000 && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"rsa_sdboot=echo Copying Image from SD to RAM... && " \
		"fatload mmc 0 0x100000 ${boot_image} && " \
		"zynqrsa 0x100000 && " \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \
	"rsa_jtagboot=echo TFTPing Image to RAM... && " \
		"tftpboot 0x100000 ${boot_image} && " \
		"zynqrsa 0x100000 && " \
177
		"bootm 0x3000000 0x2000000 0x2A00000\0"
178

179 180
/*  */
#endif /* __CONFIG_ELPHEL393_H */