blob: ba7aad8b05fda89dc367f6d96a145293da16139e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +02002/*
3 * Copyright 2013 Freescale Semiconductor, Inc.
4 *
5 * Configuration settings for the phytec PCM-052 SoM.
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +02006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11#include <asm/arch/imx-regs.h>
Lukasz Majewskiec477ec2019-02-13 22:46:51 +010012#include <linux/sizes.h>
Simon Glassfb64e362020-05-10 11:40:09 -060013#include <linux/stringify.h>
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020014
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020015#define CONFIG_SKIP_LOWLEVEL_INIT
16
17/* Enable passing of ATAGs */
18#define CONFIG_CMDLINE_TAG
19
20/* Size of malloc() pool */
Lukasz Majewskiec477ec2019-02-13 22:46:51 +010021#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * SZ_1M)
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020022
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020023/* Allow to overwrite serial and ethaddr */
24#define CONFIG_ENV_OVERWRITE
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020025
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020026/* NAND support */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020027#define CONFIG_SYS_NAND_ONFI_DETECTION
28
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020029#define CONFIG_SYS_MAX_NAND_DEVICE 1
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020030
31#define CONFIG_LOADADDR 0x82000000
32
33/* We boot from the gfxRAM area of the OCRAM. */
Stefan Agner1faaa3c2017-10-17 13:59:19 +020034#define CONFIG_BOARD_SIZE_LIMIT 520192
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020035
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +020036/* if no target-specific extra environment settings were defined by the
37 target, define an empty one */
38#ifndef PCM052_EXTRA_ENV_SETTINGS
39#define PCM052_EXTRA_ENV_SETTINGS
40#endif
41
42/* if no target-specific boot command was defined by the target,
43 define an empty one */
44#ifndef PCM052_BOOTCOMMAND
45#define PCM052_BOOTCOMMAND
46#endif
47
48/* if no target-specific extra environment settings were defined by the
49 target, define an empty one */
50#ifndef PCM052_NET_INIT
51#define PCM052_NET_INIT
52#endif
53
54/* boot command, including the target-defined one if any */
55#define CONFIG_BOOTCOMMAND PCM052_BOOTCOMMAND "run bootcmd_nand"
56
57/* Extra env settings (including the target-defined ones if any) */
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020058#define CONFIG_EXTRA_ENV_SETTINGS \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +020059 PCM052_EXTRA_ENV_SETTINGS \
60 "autoload=no\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020061 "fdt_high=0xffffffff\0" \
62 "initrd_high=0xffffffff\0" \
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +020063 "blimg_file=u-boot.vyb\0" \
64 "blimg_addr=0x81000000\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020065 "kernel_file=zImage\0" \
66 "kernel_addr=0x82000000\0" \
Albert ARIBAUD \(3ADEV\)cb2b5672016-09-26 09:08:04 +020067 "fdt_file=zImage.dtb\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020068 "fdt_addr=0x81000000\0" \
69 "ram_file=uRamdisk\0" \
70 "ram_addr=0x83000000\0" \
71 "filesys=rootfs.ubifs\0" \
72 "sys_addr=0x81000000\0" \
73 "tftploc=/path/to/tftp/directory/\0" \
74 "nfs_root=/path/to/nfs/root\0" \
75 "tftptimeout=1000\0" \
76 "tftptimeoutcountmax=1000000\0" \
Tom Rini5ad8e112017-10-22 17:55:07 -040077 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Albert ARIBAUD \(3ADEV\)99208d92016-09-26 09:08:07 +020078 "bootargs_base=setenv bootargs rw " \
79 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020080 "console=ttyLP1,115200n8\0" \
81 "bootargs_sd=setenv bootargs ${bootargs} " \
82 "root=/dev/mmcblk0p2 rootwait\0" \
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020083 "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020084 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \
85 "bootargs_nand=setenv bootargs ${bootargs} " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +020086 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020087 "bootargs_ram=setenv bootargs ${bootargs} " \
88 "root=/dev/ram rw initrd=${ram_addr}\0" \
89 "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
90 "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \
91 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \
92 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \
93 "bootz ${kernel_addr} - ${fdt_addr}\0" \
94 "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \
95 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \
96 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \
97 "bootz ${kernel_addr} - ${fdt_addr}\0" \
98 "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \
99 "nand read ${fdt_addr} dtb; " \
100 "nand read ${kernel_addr} kernel; " \
101 "bootz ${kernel_addr} - ${fdt_addr}\0" \
102 "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \
103 "nand read ${fdt_addr} dtb; " \
104 "nand read ${kernel_addr} kernel; " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +0200105 "nand read ${ram_addr} root; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200106 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200107 "update_bootloader_from_tftp=" PCM052_NET_INIT \
108 "if tftp ${blimg_addr} "\
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +0200109 "${tftpdir}${blimg_file}; then " \
110 "mtdparts default; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200111 "nand erase.part bootloader; " \
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +0200112 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200113 "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \
114 "${kernel_file}; " \
115 "then mtdparts default; " \
116 "nand erase.part kernel; " \
117 "nand write ${kernel_addr} kernel ${filesize}; " \
118 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \
119 "nand erase.part dtb; " \
120 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200121 "update_kernel_from_tftp=" PCM052_NET_INIT \
122 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200123 "then setenv fdtsize ${filesize}; " \
124 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \
125 "mtdparts default; " \
126 "nand erase.part dtb; " \
127 "nand write ${fdt_addr} dtb ${fdtsize}; " \
128 "nand erase.part kernel; " \
129 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200130 "update_rootfs_from_tftp=" PCM052_NET_INIT \
131 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200132 "then mtdparts default; " \
133 "nand erase.part root; " \
134 "ubi part root; " \
135 "ubi create rootfs; " \
136 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200137 "update_ramdisk_from_tftp=" PCM052_NET_INIT \
138 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200139 "then mtdparts default; " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +0200140 "nand erase.part root; " \
141 "nand write ${ram_addr} root ${filesize}; fi\0"
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200142
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200143/* Miscellaneous configurable options */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200144
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200145#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
146
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200147/* Physical memory map */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200148#define PHYS_SDRAM (0x80000000)
Lukasz Majewskiec477ec2019-02-13 22:46:51 +0100149#define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * SZ_1M)
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200150
151#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
152#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
153#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
154
155#define CONFIG_SYS_INIT_SP_OFFSET \
156 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
157#define CONFIG_SYS_INIT_SP_ADDR \
158 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
159
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900160/* environment organization */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200161#ifdef CONFIG_ENV_IS_IN_MMC
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200162#define CONFIG_SYS_MMC_ENV_DEV 0
163#endif
164
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200165#endif