xref: /openbmc/u-boot/include/configs/kp_imx53.h (revision 6f565821)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2018
4  * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
5  */
6 
7 #ifndef __CONFIG_H_
8 #define __CONFIG_H_
9 
10 #include <asm/arch/imx-regs.h>
11 #include <linux/sizes.h>
12 
13 #define CONFIG_SYS_FSL_CLK
14 
15 /* Size of malloc() pool */
16 #define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
17 
18 /* MMC Configs */
19 #define CONFIG_FSL_ESDHC
20 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
21 #define CONFIG_SYS_FSL_ESDHC_NUM	1
22 
23 /* Eth Configs */
24 
25 /* USB Configs */
26 #define CONFIG_USB_EHCI_MX5
27 #define CONFIG_MXC_USB_PORT	1
28 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
29 #define CONFIG_MXC_USB_FLAGS	0
30 
31 #define CONFIG_SYS_I2C_MXC
32 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
33 #define CONFIG_SYS_EEPROM_BUS_NUM 1
34 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
35 
36 /* allow to overwrite serial and ethaddr */
37 #define CONFIG_ENV_OVERWRITE
38 
39 /* Command definition */
40 #define CONFIG_LOADADDR		0x72000000	/* loadaddr env var */
41 
42 #define CONFIG_EXTRA_ENV_SETTINGS \
43 	"console=ttymxc1,115200\0"	\
44 	"fdt_addr=0x75000000\0"		\
45 	"fdt_high=0xffffffff\0"		\
46 	"scriptaddr=0x74000000\0"	\
47 	"kernel_file=fitImage\0"\
48 	"silent=1\0"\
49 	"rdinit=/sbin/init\0" \
50 	"addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
51 	"upd_image=st.4k\0" \
52 	"uboot_file=u-boot.imx\0" \
53 	"updargs=setenv bootargs console=${console} ${smp}"\
54 	       "rdinit=${rdinit} ${debug} ${displayargs}\0" \
55 	"loadusb=usb start; " \
56 	       "fatload usb 0 ${loadaddr} ${upd_image}\0" \
57 	"up=if tftp ${loadaddr} ${uboot_file}; then " \
58 	       "setexpr blkc ${filesize} / 0x200; " \
59 	       "setexpr blkc ${blkc} + 1; " \
60 	       "mmc write ${loadaddr} 0x2 ${blkc}" \
61 	"; fi\0"	  \
62 	"upwic=setenv wic_file kp-image-kp${boardsoc}${boardtype}.wic; "\
63 	       "if tftp ${loadaddr} ${wic_file}; then " \
64 	       "setexpr blkc ${filesize} / 0x200; " \
65 	       "setexpr blkc ${blkc} + 1; " \
66 	       "mmc write ${loadaddr} 0x0 ${blkc}" \
67 	"; fi\0"	  \
68 	"usbupd=echo Booting update from usb ...; " \
69 	       "setenv bootargs; " \
70 	       "run updargs; " \
71 	       "run loadusb; " \
72 	       "bootm ${loadaddr}#${fit_config}\0" \
73 	BOOTENV
74 
75 #define CONFIG_BOOTCOMMAND		"run usbupd; run distro_bootcmd"
76 
77 #define BOOT_TARGET_DEVICES(func) \
78 	func(MMC, mmc, 0) \
79 	func(DHCP, dhcp, na)
80 
81 #include <config_distro_bootcmd.h>
82 
83 #define CONFIG_ARP_TIMEOUT	200UL
84 
85 /* Miscellaneous configurable options */
86 #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
87 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
88 
89 /* Physical Memory Map */
90 #define PHYS_SDRAM_1			CSD0_BASE_ADDR
91 #define PHYS_SDRAM_1_SIZE		(512 * SZ_1M)
92 #define PHYS_SDRAM_SIZE		(PHYS_SDRAM_1_SIZE)
93 
94 #define CONFIG_SYS_SDRAM_BASE		(PHYS_SDRAM_1)
95 #define CONFIG_SYS_INIT_RAM_ADDR	(IRAM_BASE_ADDR)
96 #define CONFIG_SYS_INIT_RAM_SIZE	(IRAM_SIZE)
97 
98 #define CONFIG_SYS_INIT_SP_OFFSET \
99 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
100 #define CONFIG_SYS_INIT_SP_ADDR \
101 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
102 
103 /* environment organization */
104 #define CONFIG_ENV_OFFSET      (SZ_1M)
105 #define CONFIG_ENV_SIZE        (SZ_8K)
106 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
107 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
108 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
109 #define CONFIG_SYS_MMC_ENV_DEV 0
110 
111 #endif				/* __CONFIG_H_ */
112