blob: fe0ad34ef9c10231e24d1215752dd4585cc16bc2 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Fabio Estevam14a16132014-06-24 17:41:01 -03002/*
3 * Copyright 2014 Freescale Semiconductor, Inc.
4 *
5 * Configuration settings for the Freescale i.MX6SX Sabresd board.
Fabio Estevam14a16132014-06-24 17:41:01 -03006 */
7
Fabio Estevam14a16132014-06-24 17:41:01 -03008#ifndef __CONFIG_H
9#define __CONFIG_H
10
Simon Glass1af3c7f2020-05-10 11:40:09 -060011#include <linux/stringify.h>
12
Fabio Estevam14a16132014-06-24 17:41:01 -030013#include "mx6_common.h"
14
Tom Rini4db38662022-12-04 10:04:55 -050015#define CFG_MXC_UART_BASE UART1_BASE
Fabio Estevam14a16132014-06-24 17:41:01 -030016
Peng Fan3fe0b102016-01-28 16:55:06 +080017#ifdef CONFIG_IMX_BOOTAUX
Peng Fan3fe0b102016-01-28 16:55:06 +080018
19#define UPDATE_M4_ENV \
20 "m4image=m4_qspi.bin\0" \
21 "loadm4image=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4image}\0" \
22 "update_m4_from_sd=" \
23 "if sf probe 1:0; then " \
24 "if run loadm4image; then " \
25 "setexpr fw_sz ${filesize} + 0xffff; " \
26 "setexpr fw_sz ${fw_sz} / 0x10000; " \
27 "setexpr fw_sz ${fw_sz} * 0x10000; " \
28 "sf erase 0x0 ${fw_sz}; " \
29 "sf write ${loadaddr} 0x0 ${filesize}; " \
30 "fi; " \
31 "fi\0" \
Tom Rini56fc54a2022-06-25 11:02:47 -040032 "m4boot=sf probe 1:0; bootaux 0x78000000\0"
Peng Fan3fe0b102016-01-28 16:55:06 +080033#else
34#define UPDATE_M4_ENV ""
35#endif
36
Tom Rini0613c362022-12-04 10:03:50 -050037#define CFG_EXTRA_ENV_SETTINGS \
Peng Fan3fe0b102016-01-28 16:55:06 +080038 UPDATE_M4_ENV \
Fabio Estevam14a16132014-06-24 17:41:01 -030039 "script=boot.scr\0" \
40 "image=zImage\0" \
41 "console=ttymxc0\0" \
42 "fdt_high=0xffffffff\0" \
43 "initrd_high=0xffffffff\0" \
44 "fdt_file=imx6sx-sdb.dtb\0" \
45 "fdt_addr=0x88000000\0" \
46 "boot_fdt=try\0" \
47 "ip_dyn=yes\0" \
Ye Li85eb0952016-01-26 22:09:40 +080048 "videomode=video=ctfb:x:800,y:480,depth:24,pclk:29850,le:89,ri:164,up:23,lo:10,hs:10,vs:10,sync:0,vmode:0\0" \
Fabio Estevamd7cd8602019-12-19 14:59:42 -030049 "mmcdev=3\0" \
Fabio Estevam14a16132014-06-24 17:41:01 -030050 "mmcpart=1\0" \
Fabio Estevamd7cd8602019-12-19 14:59:42 -030051 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
Fabio Estevam14a16132014-06-24 17:41:01 -030052 "mmcargs=setenv bootargs console=${console},${baudrate} " \
Fabio Estevamf0868122017-11-22 11:15:28 -020053 "root=PARTUUID=${uuid} rootwait rw\0" \
Fabio Estevam14a16132014-06-24 17:41:01 -030054 "loadbootscript=" \
55 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
56 "bootscript=echo Running bootscript from mmc ...; " \
57 "source\0" \
58 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
59 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
60 "mmcboot=echo Booting from mmc ...; " \
Fabio Estevamf0868122017-11-22 11:15:28 -020061 "run finduuid; " \
Fabio Estevam14a16132014-06-24 17:41:01 -030062 "run mmcargs; " \
63 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
64 "if run loadfdt; then " \
65 "bootz ${loadaddr} - ${fdt_addr}; " \
66 "else " \
67 "if test ${boot_fdt} = try; then " \
68 "bootz; " \
69 "else " \
70 "echo WARN: Cannot load the DT; " \
71 "fi; " \
72 "fi; " \
73 "else " \
74 "bootz; " \
75 "fi;\0" \
76 "netargs=setenv bootargs console=${console},${baudrate} " \
77 "root=/dev/nfs " \
78 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
79 "netboot=echo Booting from net ...; " \
80 "run netargs; " \
81 "if test ${ip_dyn} = yes; then " \
82 "setenv get_cmd dhcp; " \
83 "else " \
84 "setenv get_cmd tftp; " \
85 "fi; " \
86 "${get_cmd} ${image}; " \
87 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
88 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
89 "bootz ${loadaddr} - ${fdt_addr}; " \
90 "else " \
91 "if test ${boot_fdt} = try; then " \
92 "bootz; " \
93 "else " \
94 "echo WARN: Cannot load the DT; " \
95 "fi; " \
96 "fi; " \
97 "else " \
98 "bootz; " \
Fabio Estevam6ca03f02017-11-27 10:25:10 -020099 "fi;\0" \
100 "findfdt="\
101 "if test test $board_rev = REVA ; then " \
102 "setenv fdt_file imx6sx-sdb-reva.dtb; fi; " \
Fabio Estevam14a16132014-06-24 17:41:01 -0300103
Fabio Estevam14a16132014-06-24 17:41:01 -0300104/* Miscellaneous configurable options */
Fabio Estevam14a16132014-06-24 17:41:01 -0300105
Fabio Estevam14a16132014-06-24 17:41:01 -0300106/* Physical Memory Map */
Fabio Estevam14a16132014-06-24 17:41:01 -0300107#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
Fabio Estevam14a16132014-06-24 17:41:01 -0300108
Tom Riniaa6e94d2022-11-16 13:10:37 -0500109#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini65cc0e22022-11-16 13:10:41 -0500110#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
111#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Fabio Estevam14a16132014-06-24 17:41:01 -0300112
Fabio Estevam14a16132014-06-24 17:41:01 -0300113/* MMC Configuration */
Tom Rini6cc04542022-10-28 20:27:13 -0400114#define CFG_SYS_FSL_ESDHC_ADDR USDHC4_BASE_ADDR
Fabio Estevam14a16132014-06-24 17:41:01 -0300115
Fabio Estevamd1458782014-08-15 00:24:29 -0300116/* Network */
Fabio Estevamd1458782014-08-15 00:24:29 -0300117
Tom Rinifa760c32022-12-04 10:03:53 -0500118#define CFG_FEC_MXC_PHYADDR 0x1
Fabio Estevamd1458782014-08-15 00:24:29 -0300119
Peng Fana511a3e2014-11-10 08:50:40 +0800120#ifdef CONFIG_CMD_USB
Tom Rinidd11fdc2022-12-04 10:04:56 -0500121#define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
122#define CFG_MXC_USB_FLAGS 0
Peng Fana511a3e2014-11-10 08:50:40 +0800123#endif
124
Fabio Estevamc860eed2014-08-25 14:26:46 -0300125#ifdef CONFIG_CMD_PCI
Tom Rini7906f912022-12-04 10:13:25 -0500126#define CFG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 0)
Tom Rini52139622022-12-04 10:13:26 -0500127#define CFG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 1)
Fabio Estevamc860eed2014-08-25 14:26:46 -0300128#endif
129
Ye Li85eb0952016-01-26 22:09:40 +0800130#define MXS_LCDIF_BASE MX6SX_LCDIF1_BASE_ADDR
Ye Li85eb0952016-01-26 22:09:40 +0800131
Fabio Estevam14a16132014-06-24 17:41:01 -0300132#endif /* __CONFIG_H */