Merge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdog
[platform/kernel/u-boot.git] / include / configs / mx7dsabresd.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2015 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale i.MX7D SABRESD board.
6  */
7
8 #ifndef __MX7D_SABRESD_CONFIG_H
9 #define __MX7D_SABRESD_CONFIG_H
10
11 #include "mx7_common.h"
12
13 #define PHYS_SDRAM_SIZE                 SZ_1G
14
15 #define CONFIG_MXC_UART_BASE            UART1_IPS_BASE_ADDR
16
17 #ifdef CONFIG_IMX_BOOTAUX
18 /* Set to QSPI1 A flash at default */
19 #define CONFIG_SYS_AUXCORE_BOOTDATA 0x60000000
20
21 #define UPDATE_M4_ENV \
22         "m4image=m4_qspi.bin\0" \
23         "loadm4image=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4image}\0" \
24         "update_m4_from_sd=" \
25                 "if sf probe 0:0; then " \
26                         "if run loadm4image; then " \
27                                 "setexpr fw_sz ${filesize} + 0xffff; " \
28                                 "setexpr fw_sz ${fw_sz} / 0x10000; "    \
29                                 "setexpr fw_sz ${fw_sz} * 0x10000; "    \
30                                 "sf erase 0x0 ${fw_sz}; " \
31                                 "sf write ${loadaddr} 0x0 ${filesize}; " \
32                         "fi; " \
33                 "fi\0" \
34         "m4boot=sf probe 0:0; bootaux "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)"\0"
35 #else
36 #define UPDATE_M4_ENV ""
37 #endif
38
39 #define CONFIG_MFG_ENV_SETTINGS \
40         "mfgtool_args=setenv bootargs console=${console},${baudrate} " \
41                 "rdinit=/linuxrc " \
42                 "g_mass_storage.stall=0 g_mass_storage.removable=1 " \
43                 "g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\
44                 "g_mass_storage.iSerialNumber=\"\" "\
45                 "clk_ignore_unused "\
46                 "\0" \
47         "initrd_addr=0x83800000\0" \
48         "initrd_high=0xffffffff\0" \
49         "bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
50
51 #define CONFIG_DFU_ENV_SETTINGS \
52         "dfu_alt_info=image raw 0 0x800000;"\
53                 "u-boot raw 0 0x4000;"\
54                 "bootimg part 0 1;"\
55                 "rootfs part 0 2\0" \
56
57 #define CONFIG_EXTRA_ENV_SETTINGS \
58         UPDATE_M4_ENV \
59         CONFIG_MFG_ENV_SETTINGS \
60         CONFIG_DFU_ENV_SETTINGS \
61         "script=boot.scr\0" \
62         "image=zImage\0" \
63         "console=ttymxc0\0" \
64         "fdt_high=0xffffffff\0" \
65         "finduuid=part uuid mmc 0:1 uuid\0" \
66         "initrd_high=0xffffffff\0" \
67         "fdtfile=imx7d-sdb.dtb\0" \
68         "fdt_addr=0x83000000\0" \
69         "fdt_addr_r=0x83000000\0" \
70         "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
71         "pxefile_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
72         "ramdisk_addr_r=0x83100000\0" \
73         "ramdiskaddr=0x83100000\0" \
74         "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
75         "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \
76         BOOTENV
77
78 #define BOOT_TARGET_DEVICES(func) \
79         func(MMC, mmc, 0) \
80         func(DHCP, dhcp, na) \
81         func(PXE, pxe, na)
82
83 #include <config_distro_bootcmd.h>
84
85 /* Physical Memory Map */
86 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
87
88 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
89 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
90 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
91
92 #define CONFIG_SYS_INIT_SP_OFFSET \
93         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
94 #define CONFIG_SYS_INIT_SP_ADDR \
95         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
96
97 /* environment organization */
98
99 /*
100  * If want to use nand, define CONFIG_NAND_MXS and rework board
101  * to support nand, since emmc has pin conflicts with nand
102  */
103 #ifdef CONFIG_NAND_MXS
104 /* NAND stuff */
105 #define CONFIG_SYS_MAX_NAND_DEVICE      1
106 #define CONFIG_SYS_NAND_BASE            0x40000000
107
108 /* DMA stuff, needed for GPMI/MXS NAND support */
109 #endif
110
111 /* USB Configs */
112 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
113
114 #define CONFIG_USBD_HS
115
116 #endif  /* __CONFIG_H */