blob: 327ab37791b66dd73745a9aa2f192fa6fb12e422 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Albert ARIBAUD \(3ADEV\)931a1d22015-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\)931a1d22015-09-21 22:43:39 +02006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11#include <asm/arch/imx-regs.h>
Lukasz Majewski8d917402019-02-13 22:46:51 +010012#include <linux/sizes.h>
Simon Glass1af3c7f2020-05-10 11:40:09 -060013#include <linux/stringify.h>
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020014
Albert ARIBAUD \(3ADEV\)931a1d22015-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 Majewski8d917402019-02-13 22:46:51 +010021#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * SZ_1M)
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020022
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020023/* NAND support */
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020024#define CONFIG_SYS_NAND_ONFI_DETECTION
25
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020026#define CONFIG_SYS_MAX_NAND_DEVICE 1
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020027
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020028/* We boot from the gfxRAM area of the OCRAM. */
Stefan Agnerc0f432c2017-10-17 13:59:19 +020029#define CONFIG_BOARD_SIZE_LIMIT 520192
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020030
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +020031/* if no target-specific extra environment settings were defined by the
32 target, define an empty one */
33#ifndef PCM052_EXTRA_ENV_SETTINGS
34#define PCM052_EXTRA_ENV_SETTINGS
35#endif
36
37/* if no target-specific boot command was defined by the target,
38 define an empty one */
39#ifndef PCM052_BOOTCOMMAND
40#define PCM052_BOOTCOMMAND
41#endif
42
43/* if no target-specific extra environment settings were defined by the
44 target, define an empty one */
45#ifndef PCM052_NET_INIT
46#define PCM052_NET_INIT
47#endif
48
49/* boot command, including the target-defined one if any */
50#define CONFIG_BOOTCOMMAND PCM052_BOOTCOMMAND "run bootcmd_nand"
51
52/* Extra env settings (including the target-defined ones if any) */
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020053#define CONFIG_EXTRA_ENV_SETTINGS \
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +020054 PCM052_EXTRA_ENV_SETTINGS \
55 "autoload=no\0" \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020056 "fdt_high=0xffffffff\0" \
57 "initrd_high=0xffffffff\0" \
Albert ARIBAUD \(3ADEV\)ed0c2c02016-09-26 09:08:06 +020058 "blimg_file=u-boot.vyb\0" \
59 "blimg_addr=0x81000000\0" \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020060 "kernel_file=zImage\0" \
61 "kernel_addr=0x82000000\0" \
Albert ARIBAUD \(3ADEV\)083e4fd2016-09-26 09:08:04 +020062 "fdt_file=zImage.dtb\0" \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020063 "fdt_addr=0x81000000\0" \
64 "ram_file=uRamdisk\0" \
65 "ram_addr=0x83000000\0" \
66 "filesys=rootfs.ubifs\0" \
67 "sys_addr=0x81000000\0" \
68 "tftploc=/path/to/tftp/directory/\0" \
69 "nfs_root=/path/to/nfs/root\0" \
70 "tftptimeout=1000\0" \
71 "tftptimeoutcountmax=1000000\0" \
Tom Rini43ede0b2017-10-22 17:55:07 -040072 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Albert ARIBAUD \(3ADEV\)a7e5f7f2016-09-26 09:08:07 +020073 "bootargs_base=setenv bootargs rw " \
74 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020075 "console=ttyLP1,115200n8\0" \
76 "bootargs_sd=setenv bootargs ${bootargs} " \
77 "root=/dev/mmcblk0p2 rootwait\0" \
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +020078 "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020079 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \
80 "bootargs_nand=setenv bootargs ${bootargs} " \
Albert ARIBAUD \(3ADEV\)27f7d4f2016-09-26 09:08:03 +020081 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +020082 "bootargs_ram=setenv bootargs ${bootargs} " \
83 "root=/dev/ram rw initrd=${ram_addr}\0" \
84 "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
85 "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \
86 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \
87 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \
88 "bootz ${kernel_addr} - ${fdt_addr}\0" \
89 "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \
90 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \
91 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \
92 "bootz ${kernel_addr} - ${fdt_addr}\0" \
93 "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \
94 "nand read ${fdt_addr} dtb; " \
95 "nand read ${kernel_addr} kernel; " \
96 "bootz ${kernel_addr} - ${fdt_addr}\0" \
97 "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \
98 "nand read ${fdt_addr} dtb; " \
99 "nand read ${kernel_addr} kernel; " \
Albert ARIBAUD \(3ADEV\)27f7d4f2016-09-26 09:08:03 +0200100 "nand read ${ram_addr} root; " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200101 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +0200102 "update_bootloader_from_tftp=" PCM052_NET_INIT \
103 "if tftp ${blimg_addr} "\
Albert ARIBAUD \(3ADEV\)ed0c2c02016-09-26 09:08:06 +0200104 "${tftpdir}${blimg_file}; then " \
105 "mtdparts default; " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200106 "nand erase.part bootloader; " \
Albert ARIBAUD \(3ADEV\)ed0c2c02016-09-26 09:08:06 +0200107 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200108 "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \
109 "${kernel_file}; " \
110 "then mtdparts default; " \
111 "nand erase.part kernel; " \
112 "nand write ${kernel_addr} kernel ${filesize}; " \
113 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \
114 "nand erase.part dtb; " \
115 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +0200116 "update_kernel_from_tftp=" PCM052_NET_INIT \
117 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200118 "then setenv fdtsize ${filesize}; " \
119 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \
120 "mtdparts default; " \
121 "nand erase.part dtb; " \
122 "nand write ${fdt_addr} dtb ${fdtsize}; " \
123 "nand erase.part kernel; " \
124 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +0200125 "update_rootfs_from_tftp=" PCM052_NET_INIT \
126 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200127 "then mtdparts default; " \
128 "nand erase.part root; " \
129 "ubi part root; " \
130 "ubi create rootfs; " \
131 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)27192d12016-09-26 09:08:08 +0200132 "update_ramdisk_from_tftp=" PCM052_NET_INIT \
133 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \
Albert ARIBAUD (3ADEV)040ef8f2015-10-11 20:06:39 +0200134 "then mtdparts default; " \
Albert ARIBAUD \(3ADEV\)27f7d4f2016-09-26 09:08:03 +0200135 "nand erase.part root; " \
136 "nand write ${ram_addr} root ${filesize}; fi\0"
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200137
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200138/* Miscellaneous configurable options */
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200139
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200140/* Physical memory map */
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200141#define PHYS_SDRAM (0x80000000)
Lukasz Majewski8d917402019-02-13 22:46:51 +0100142#define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * SZ_1M)
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200143
144#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
145#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
146#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
147
148#define CONFIG_SYS_INIT_SP_OFFSET \
149 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
150#define CONFIG_SYS_INIT_SP_ADDR \
151 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
152
Masahiro Yamadae856bdc2017-02-11 22:43:54 +0900153/* environment organization */
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200154
Albert ARIBAUD \(3ADEV\)931a1d22015-09-21 22:43:39 +0200155#endif