blob: 676144a668aa2acf2cf2ebabd102afdb430fb1e3 [file] [log] [blame]
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00001/*
Pavel Machek5e2d70a2014-09-08 14:08:45 +02002 * Copyright (C) 2014 Marek Vasut <marex@denx.de>
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00003 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00005 */
Pavel Machek5e2d70a2014-09-08 14:08:45 +02006#ifndef __CONFIG_SOCFPGA_CYCLONE5_H__
7#define __CONFIG_SOCFPGA_CYCLONE5_H__
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00008
9#include <asm/arch/socfpga_base_addrs.h>
Chin Liang See70fa4e72013-09-11 11:24:48 -050010#include "../../board/altera/socfpga/pinmux_config.h"
Chin Liang See63550242014-06-10 01:17:42 -050011#include "../../board/altera/socfpga/iocsr_config.h"
Chin Liang Seecb350602014-03-04 22:13:53 -060012#include "../../board/altera/socfpga/pll_config.h"
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000013
Marek Vasutd4a4db12014-09-08 14:08:45 +020014/* U-Boot Commands */
15#define CONFIG_SYS_NO_FLASH
16#include <config_cmd_default.h>
17#define CONFIG_DOS_PARTITION
18#define CONFIG_FAT_WRITE
19#define CONFIG_HW_WATCHDOG
Marek Vasutbd279e32014-09-15 01:27:57 +020020
Marek Vasutd4a4db12014-09-08 14:08:45 +020021#define CONFIG_CMD_ASKENV
22#define CONFIG_CMD_BOOTZ
23#define CONFIG_CMD_CACHE
Marek Vasut01c09552014-12-30 20:04:20 +010024#define CONFIG_CMD_DFU
Marek Vasutd4a4db12014-09-08 14:08:45 +020025#define CONFIG_CMD_DHCP
26#define CONFIG_CMD_EXT4
27#define CONFIG_CMD_EXT4_WRITE
28#define CONFIG_CMD_FAT
29#define CONFIG_CMD_FPGA
Marek Vasut08c71a62014-09-19 13:28:47 +020030#define CONFIG_CMD_FS_GENERIC
Marek Vasutd4a4db12014-09-08 14:08:45 +020031#define CONFIG_CMD_GREPENV
32#define CONFIG_CMD_MII
33#define CONFIG_CMD_MMC
34#define CONFIG_CMD_NET
35#define CONFIG_CMD_PING
36#define CONFIG_CMD_SETEXPR
Marek Vasut01c09552014-12-30 20:04:20 +010037#define CONFIG_CMD_USB
38#define CONFIG_CMD_USB_MASS_STORAGE
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000039
Marek Vasutd4a4db12014-09-08 14:08:45 +020040#define CONFIG_REGEX /* Enable regular expression support */
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000041
Pavel Machek5e2d70a2014-09-08 14:08:45 +020042/* Memory configurations */
Marek Vasutd4a4db12014-09-08 14:08:45 +020043#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCDK */
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000044
Marek Vasutd4a4db12014-09-08 14:08:45 +020045/* Booting Linux */
46#define CONFIG_BOOTDELAY 3
47#define CONFIG_BOOTFILE "zImage"
Anatolij Gustschinb02c7982014-11-07 01:12:03 +010048#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
Chin Liang See4a6a2282014-09-19 05:33:19 -050049#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
Marek Vasutd4a4db12014-09-08 14:08:45 +020050#define CONFIG_BOOTCOMMAND "run ramboot"
Chin Liang See4a6a2282014-09-19 05:33:19 -050051#else
Marek Vasutd4a4db12014-09-08 14:08:45 +020052#define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot"
Chin Liang See4a6a2282014-09-19 05:33:19 -050053#endif
Marek Vasutd4a4db12014-09-08 14:08:45 +020054#define CONFIG_LOADADDR 0x8000
55#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000056
Pavel Machek5e2d70a2014-09-08 14:08:45 +020057/* Ethernet on SoC (EMAC) */
58#if defined(CONFIG_CMD_NET)
Marek Vasut3835fbe2014-10-10 01:50:23 +020059#define CONFIG_EMAC_BASE SOCFPGA_EMAC1_ADDRESS
Marek Vasutd4a4db12014-09-08 14:08:45 +020060#define CONFIG_PHY_INTERFACE_MODE PHY_INTERFACE_MODE_RGMII
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000061
Marek Vasutd4a4db12014-09-08 14:08:45 +020062/* PHY */
Marek Vasutd4a4db12014-09-08 14:08:45 +020063#define CONFIG_PHY_MICREL
64#define CONFIG_PHY_MICREL_KSZ9021
65#define CONFIG_KSZ9021_CLK_SKEW_ENV "micrel-ksz9021-clk-skew"
66#define CONFIG_KSZ9021_CLK_SKEW_VAL 0xf0f0
67#define CONFIG_KSZ9021_DATA_SKEW_ENV "micrel-ksz9021-data-skew"
68#define CONFIG_KSZ9021_DATA_SKEW_VAL 0x0
69
Chin Liang See9cd12042013-08-07 10:06:56 -050070#endif
Pavel Machekce340e92014-07-14 14:14:17 +020071
Marek Vasut01c09552014-12-30 20:04:20 +010072/* USB */
73#ifdef CONFIG_CMD_USB
74#define CONFIG_USB_DWC2_REG_ADDR SOCFPGA_USB1_ADDRESS
75#endif
76#define CONFIG_G_DNL_MANUFACTURER "Altera"
77
Pavel Machek5e2d70a2014-09-08 14:08:45 +020078/* Extra Environment */
79#define CONFIG_HOSTNAME socfpga_cyclone5
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000080
Marek Vasutd4a4db12014-09-08 14:08:45 +020081#define CONFIG_EXTRA_ENV_SETTINGS \
82 "verify=n\0" \
83 "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
84 "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
85 "bootm ${loadaddr} - ${fdt_addr}\0" \
86 "bootimage=zImage\0" \
87 "fdt_addr=100\0" \
88 "fdtimage=socfpga.dtb\0" \
89 "fsloadcmd=ext2load\0" \
90 "bootm ${loadaddr} - ${fdt_addr}\0" \
91 "mmcroot=/dev/mmcblk0p2\0" \
92 "mmcboot=setenv bootargs " CONFIG_BOOTARGS \
93 " root=${mmcroot} rw rootwait;" \
94 "bootz ${loadaddr} - ${fdt_addr}\0" \
95 "mmcload=mmc rescan;" \
Marek Vasut08c71a62014-09-19 13:28:47 +020096 "load mmc 0:1 ${loadaddr} ${bootimage};" \
97 "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
Marek Vasutd4a4db12014-09-08 14:08:45 +020098 "qspiroot=/dev/mtdblock0\0" \
99 "qspirootfstype=jffs2\0" \
100 "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
101 " root=${qspiroot} rw rootfstype=${qspirootfstype};"\
102 "bootm ${loadaddr} - ${fdt_addr}\0"
Dinh Nguyenad51f7c2012-10-04 06:46:02 +0000103
Pavel Machek5e2d70a2014-09-08 14:08:45 +0200104/* The rest of the configuration is shared */
105#include <configs/socfpga_common.h>
Chin Liang See561c9d42014-06-10 01:11:04 -0500106
Pavel Machek5e2d70a2014-09-08 14:08:45 +0200107#endif /* __CONFIG_SOCFPGA_CYCLONE5_H__ */