blob: f67fafd756e661e7da4cfd18267483b9844ec3a8 [file] [log] [blame]
Stefan Roeseae9996c2015-11-18 11:06:09 +01001/*
2 * Copyright (C) 2015 Stefan Roese <sr@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#ifndef __CONFIG_SOCFPGA_SR1500_H__
7#define __CONFIG_SOCFPGA_SR1500_H__
8
9#include <asm/arch/base_addr_ac5.h>
10
Stefan Roeseae9996c2015-11-18 11:06:09 +010011#define CONFIG_FAT_WRITE
12
13#define CONFIG_HW_WATCHDOG
14
Stefan Roeseae9996c2015-11-18 11:06:09 +010015/* Memory configurations */
16#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SR1500 */
17
18/* Booting Linux */
Stefan Roeseae9996c2015-11-18 11:06:09 +010019#define CONFIG_BOOTFILE "uImage"
Stefan Roese77cd5362016-06-01 13:24:58 +020020#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
Stefan Roeseae9996c2015-11-18 11:06:09 +010021#define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot"
22#define CONFIG_LOADADDR 0x01000000
23#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Stefan Roeseae9996c2015-11-18 11:06:09 +010024
25/* Ethernet on SoC (EMAC) */
26#define CONFIG_PHY_INTERFACE_MODE PHY_INTERFACE_MODE_RGMII
27/* The PHY is autodetected, so no MII PHY address is needed here */
28#define CONFIG_PHY_MARVELL
29#define PHY_ANEG_TIMEOUT 8000
30
Stefan Roeseae9996c2015-11-18 11:06:09 +010031#define CONFIG_EXTRA_ENV_SETTINGS \
32 "verify=n\0" \
Marek Vasutf6060ce2016-04-03 19:11:12 +020033 "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
Stefan Roeseae9996c2015-11-18 11:06:09 +010034 "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
35 "bootm ${loadaddr} - ${fdt_addr}\0" \
36 "bootimage=zImage\0" \
37 "fdt_addr=100\0" \
38 "fdtimage=socfpga.dtb\0" \
39 "fsloadcmd=ext2load\0" \
40 "bootm ${loadaddr} - ${fdt_addr}\0" \
41 "mmcroot=/dev/mmcblk0p2\0" \
42 "mmcboot=setenv bootargs " CONFIG_BOOTARGS \
43 " root=${mmcroot} rw rootwait;" \
44 "bootz ${loadaddr} - ${fdt_addr}\0" \
45 "mmcload=mmc rescan;" \
46 "load mmc 0:1 ${loadaddr} ${bootimage};" \
47 "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
Chin Liang Seeb3bb1112015-12-22 15:32:38 +080048 "qspiload=sf probe && mtdparts default && run ubiload\0" \
Stefan Roeseae9996c2015-11-18 11:06:09 +010049 "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
Chin Liang See94f53a72015-12-22 15:32:42 +080050 " ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
51 "bootz ${loadaddr} - ${fdt_addr}\0" \
Chin Liang Seeeb450222015-12-22 15:32:34 +080052 "ubiload=ubi part UBI && ubifsmount ubi0 && " \
53 "ubifsload ${loadaddr} /boot/${bootimage} && " \
54 "ubifsload ${fdt_addr} /boot/${fdtimage}\0"
Stefan Roeseae9996c2015-11-18 11:06:09 +010055
56/* Environment */
57#define CONFIG_ENV_IS_IN_SPI_FLASH
58
59/* Enable SPI NOR flash reset, needed for SPI booting */
60#define CONFIG_SPI_N25Q256A_RESET
61
62/*
63 * Bootcounter
64 */
65#define CONFIG_BOOTCOUNT_LIMIT
66/* last 2 lwords in OCRAM */
67#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8
68#define CONFIG_SYS_BOOTCOUNT_BE
69
Stefan Roeseae9996c2015-11-18 11:06:09 +010070/* Environment setting for SPI flash */
Stefan Roeseae9996c2015-11-18 11:06:09 +010071#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
72#define CONFIG_ENV_SECT_SIZE (64 * 1024)
73#define CONFIG_ENV_SIZE (16 * 1024)
Stefan Roese93d9fc22016-03-03 16:57:39 +010074#define CONFIG_ENV_OFFSET 0x000e0000
Stefan Roeseae9996c2015-11-18 11:06:09 +010075#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
76#define CONFIG_ENV_SPI_BUS 0
77#define CONFIG_ENV_SPI_CS 0
78#define CONFIG_ENV_SPI_MODE SPI_MODE_3
Stefan Roese93d9fc22016-03-03 16:57:39 +010079#define CONFIG_ENV_SPI_MAX_HZ 100000000 /* Use max of 100MHz */
80#define CONFIG_SF_DEFAULT_SPEED 100000000
81
82/*
83 * The QSPI NOR flash layout on SR1500:
84 *
85 * 0000.0000 - 0003.ffff: SPL (4 times)
86 * 0004.0000 - 000d.ffff: U-Boot
87 * 000e.0000 - 000e.ffff: env1
88 * 000f.0000 - 000f.ffff: env2
89 */
Stefan Roeseae9996c2015-11-18 11:06:09 +010090
Marek Vasutb72041c2016-02-26 19:11:30 +010091/* The rest of the configuration is shared */
92#include <configs/socfpga_common.h>
93
Stefan Roeseae9996c2015-11-18 11:06:09 +010094#endif /* __CONFIG_SOCFPGA_SR1500_H__ */