Merge tag 'u-boot-stm32-20211012' of https://source.denx.de/u-boot/custodians/u-boot-stm
[platform/kernel/u-boot.git] / include / configs / pcm052.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2013 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the phytec PCM-052 SoM.
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 #include <asm/arch/imx-regs.h>
12 #include <linux/sizes.h>
13 #include <linux/stringify.h>
14
15 /* NAND support */
16
17 #define CONFIG_SYS_MAX_NAND_DEVICE      1
18
19 /* We boot from the gfxRAM area of the OCRAM. */
20 #define CONFIG_BOARD_SIZE_LIMIT         520192
21
22 /* if no target-specific extra environment settings were defined by the
23    target, define an empty one */
24 #ifndef PCM052_EXTRA_ENV_SETTINGS
25 #define PCM052_EXTRA_ENV_SETTINGS
26 #endif
27
28 /* if no target-specific boot command was defined by the target,
29    define an empty one */
30 #ifndef PCM052_BOOTCOMMAND
31 #define PCM052_BOOTCOMMAND
32 #endif
33
34 /* if no target-specific extra environment settings were defined by the
35    target, define an empty one */
36 #ifndef PCM052_NET_INIT
37 #define PCM052_NET_INIT
38 #endif
39
40 /* boot command, including the target-defined one if any */
41 #define CONFIG_BOOTCOMMAND      PCM052_BOOTCOMMAND "run bootcmd_nand"
42
43 /* Extra env settings (including the target-defined ones if any) */
44 #define CONFIG_EXTRA_ENV_SETTINGS \
45         PCM052_EXTRA_ENV_SETTINGS \
46         "autoload=no\0" \
47         "fdt_high=0xffffffff\0" \
48         "initrd_high=0xffffffff\0" \
49         "blimg_file=u-boot.vyb\0" \
50         "blimg_addr=0x81000000\0" \
51         "kernel_file=zImage\0" \
52         "kernel_addr=0x82000000\0" \
53         "fdt_file=zImage.dtb\0" \
54         "fdt_addr=0x81000000\0" \
55         "ram_file=uRamdisk\0" \
56         "ram_addr=0x83000000\0" \
57         "filesys=rootfs.ubifs\0" \
58         "sys_addr=0x81000000\0" \
59         "tftploc=/path/to/tftp/directory/\0" \
60         "nfs_root=/path/to/nfs/root\0" \
61         "tftptimeout=1000\0" \
62         "tftptimeoutcountmax=1000000\0" \
63         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
64         "bootargs_base=setenv bootargs rw " \
65                 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
66                 "console=ttyLP1,115200n8\0" \
67         "bootargs_sd=setenv bootargs ${bootargs} " \
68                 "root=/dev/mmcblk0p2 rootwait\0" \
69         "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \
70                 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \
71         "bootargs_nand=setenv bootargs ${bootargs} " \
72                 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \
73         "bootargs_ram=setenv bootargs ${bootargs} " \
74                 "root=/dev/ram rw initrd=${ram_addr}\0" \
75         "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
76         "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \
77                 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \
78                 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \
79                 "bootz ${kernel_addr} - ${fdt_addr}\0" \
80         "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \
81                 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \
82                 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \
83                 "bootz ${kernel_addr} - ${fdt_addr}\0" \
84         "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \
85                 "nand read ${fdt_addr} dtb; " \
86                 "nand read ${kernel_addr} kernel; " \
87                 "bootz ${kernel_addr} - ${fdt_addr}\0" \
88         "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \
89                 "nand read ${fdt_addr} dtb; " \
90                 "nand read ${kernel_addr} kernel; " \
91                 "nand read ${ram_addr} root; " \
92                 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \
93         "update_bootloader_from_tftp=" PCM052_NET_INIT \
94                 "if tftp ${blimg_addr} "\
95                 "${tftpdir}${blimg_file}; then " \
96                 "mtdparts default; " \
97                 "nand erase.part bootloader; " \
98                 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \
99         "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \
100                 "${kernel_file}; " \
101                 "then mtdparts default; " \
102                 "nand erase.part kernel; " \
103                 "nand write ${kernel_addr} kernel ${filesize}; " \
104                 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \
105                 "nand erase.part dtb; " \
106                 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \
107         "update_kernel_from_tftp=" PCM052_NET_INIT \
108                 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \
109                 "then setenv fdtsize ${filesize}; " \
110                 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \
111                 "mtdparts default; " \
112                 "nand erase.part dtb; " \
113                 "nand write ${fdt_addr} dtb ${fdtsize}; " \
114                 "nand erase.part kernel; " \
115                 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \
116         "update_rootfs_from_tftp=" PCM052_NET_INIT \
117                 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \
118                 "then mtdparts default; " \
119                 "nand erase.part root; " \
120                 "ubi part root; " \
121                 "ubi create rootfs; " \
122                 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \
123         "update_ramdisk_from_tftp=" PCM052_NET_INIT \
124                 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \
125                 "then mtdparts default; " \
126                 "nand erase.part root; " \
127                 "nand write ${ram_addr} root ${filesize}; fi\0"
128
129 /* Miscellaneous configurable options */
130
131 /* Physical memory map */
132 #define PHYS_SDRAM                      (0x80000000)
133 #define PHYS_SDRAM_SIZE                 (CONFIG_PCM052_DDR_SIZE * SZ_1M)
134
135 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
136 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
137 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
138
139 #define CONFIG_SYS_INIT_SP_OFFSET \
140         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
141 #define CONFIG_SYS_INIT_SP_ADDR \
142         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
143
144 /* environment organization */
145
146 #endif