1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Configuration settings for the Novena U-Boot.
4 *
5 * Copyright (C) 2014 Marek Vasut <marex@denx.de>
6 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11/* System configurations */
12
13#include "mx6_common.h"
14
15/* U-Boot Commands */
16
17/* U-Boot general configurations */
18
19/* U-Boot environment */
20/*
21 * Environment is on MMC, starting at offset 512KiB from start of the card.
22 * Please place first partition at offset 1MiB from the start of the card
23 * as recommended by GNU/fdisk. See below for details:
24 * http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/disc-partition-alignment.html
25 */
26
27/* Booting Linux */
28
29/* Physical Memory Map */
30#define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
31
32#define CFG_SYS_SDRAM_BASE		PHYS_SDRAM
33#define CFG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
34#define CFG_SYS_INIT_RAM_SIZE	IRAM_SIZE
35
36/* I2C EEPROM */
37
38/* MMC Configs */
39#define CFG_SYS_FSL_ESDHC_ADDR	0
40#define CFG_SYS_FSL_USDHC_NUM	2
41
42/* PCI express */
43#ifdef CONFIG_CMD_PCI
44#define CFG_PCIE_IMX_PERST_GPIO	IMX_GPIO_NR(3, 29)
45#define CFG_PCIE_IMX_POWER_GPIO	IMX_GPIO_NR(7, 12)
46#endif
47
48/* PMIC */
49#define CFG_POWER_PFUZE100_I2C_ADDR	0x08
50
51/* UART */
52#define CFG_MXC_UART_BASE		UART2_BASE
53
54/* USB Configs */
55#ifdef CONFIG_CMD_USB
56#define CFG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
57#define CFG_MXC_USB_FLAGS		0
58#endif
59
60/* Extra U-Boot environment. */
61#define CFG_EXTRA_ENV_SETTINGS					\
62	"fdt_high=0xffffffff\0"						\
63	"initrd_high=0xffffffff\0"					\
64	"consdev=ttymxc1\0"						\
65	"baudrate=115200\0"						\
66	"bootdev=/dev/mmcblk0p1\0"					\
67	"rootdev=/dev/mmcblk0p2\0"					\
68	"netdev=eth0\0"							\
69	"kernel_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0"		\
70	"pxefile_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0"		\
71	"scriptaddr="__stringify(CONFIG_SYS_LOAD_ADDR)"\0"			\
72	"ramdisk_addr_r=0x28000000\0"					\
73	"fdt_addr_r=0x18000000\0"					\
74	"fdtfile=imx6q-novena.dtb\0"					\
75	"stdout=serial,vidconsole\0"					\
76	"stderr=serial,vidconsole\0"					\
77	"addcons="							\
78		"setenv bootargs ${bootargs} "				\
79		"console=${consdev},${baudrate}\0"			\
80	"addip="							\
81		"setenv bootargs ${bootargs} "				\
82		"ip=${ipaddr}:${serverip}:${gatewayip}:"		\
83			"${netmask}:${hostname}:${netdev}:off\0"	\
84	"addmisc="							\
85		"setenv bootargs ${bootargs} ${miscargs}\0"		\
86	"addargs=run addcons addmisc\0"					\
87	"mmcload="							\
88		"mmc rescan ; "						\
89		"ext4load mmc 0:1 ${kernel_addr_r} ${bootfile}\0"	\
90	"netload="							\
91		"tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"	\
92	"miscargs=nohlt panic=1\0"					\
93	"mmcargs=setenv bootargs root=${rootdev} rw rootwait\0"		\
94	"nfsargs="							\
95		"setenv bootargs root=/dev/nfs rw "			\
96			"nfsroot=${serverip}:${rootpath},v3,tcp\0"	\
97	"mmc_mmc="							\
98		"run mmcload mmcargs addargs ; "			\
99		"bootm ${kernel_addr_r}\0"				\
100	"mmc_nfs="							\
101		"run mmcload nfsargs addip addargs ; "			\
102		"bootm ${kernel_addr_r}\0"				\
103	"net_mmc="							\
104		"run netload mmcargs addargs ; "			\
105		"bootm ${kernel_addr_r}\0"				\
106	"net_nfs="							\
107		"run netload nfsargs addip addargs ; "			\
108		"bootm ${kernel_addr_r}\0"				\
109	"update_sd_spl_filename=SPL\0"					\
110	"update_sd_uboot_filename=u-boot.img\0"				\
111	"update_sd_firmware="	/* Update the SD firmware partition */	\
112		"if mmc rescan ; then "					\
113		"if dhcp ${update_sd_spl_filename} ; then "		\
114		"mmc write ${loadaddr} 2 0x200 ; "			\
115		"fi ; "							\
116		"if dhcp ${update_sd_uboot_filename} ; then "		\
117		"fatwrite mmc 0:1 ${loadaddr} u-boot.img ${filesize} ; "\
118		"fi ; "							\
119		"fi\0"							\
120	BOOTENV
121
122#define BOOT_TARGET_DEVICES(func) \
123	func(MMC, mmc, 0) \
124	func(USB, usb, 0) \
125	func(SATA, sata, 0) \
126	func(PXE, pxe, na) \
127	func(DHCP, dhcp, na)
128
129#include <config_distro_bootcmd.h>
130
131#endif				/* __CONFIG_H */
132