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