blob: 5b2e084a2245384569a67a01960197d1f7da457c [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/* NAND support */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020016#define CONFIG_SYS_NAND_ONFI_DETECTION
17
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020018#define CONFIG_SYS_MAX_NAND_DEVICE 1
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020019
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020020/* We boot from the gfxRAM area of the OCRAM. */
Stefan Agner1faaa3c2017-10-17 13:59:19 +020021#define CONFIG_BOARD_SIZE_LIMIT 520192
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020022
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +020023/* if no target-specific extra environment settings were defined by the
24 target, define an empty one */
25#ifndef PCM052_EXTRA_ENV_SETTINGS
26#define PCM052_EXTRA_ENV_SETTINGS
27#endif
28
29/* if no target-specific boot command was defined by the target,
30 define an empty one */
31#ifndef PCM052_BOOTCOMMAND
32#define PCM052_BOOTCOMMAND
33#endif
34
35/* if no target-specific extra environment settings were defined by the
36 target, define an empty one */
37#ifndef PCM052_NET_INIT
38#define PCM052_NET_INIT
39#endif
40
41/* boot command, including the target-defined one if any */
42#define CONFIG_BOOTCOMMAND PCM052_BOOTCOMMAND "run bootcmd_nand"
43
44/* Extra env settings (including the target-defined ones if any) */
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020045#define CONFIG_EXTRA_ENV_SETTINGS \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +020046 PCM052_EXTRA_ENV_SETTINGS \
47 "autoload=no\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020048 "fdt_high=0xffffffff\0" \
49 "initrd_high=0xffffffff\0" \
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +020050 "blimg_file=u-boot.vyb\0" \
51 "blimg_addr=0x81000000\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020052 "kernel_file=zImage\0" \
53 "kernel_addr=0x82000000\0" \
Albert ARIBAUD \(3ADEV\)cb2b5672016-09-26 09:08:04 +020054 "fdt_file=zImage.dtb\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020055 "fdt_addr=0x81000000\0" \
56 "ram_file=uRamdisk\0" \
57 "ram_addr=0x83000000\0" \
58 "filesys=rootfs.ubifs\0" \
59 "sys_addr=0x81000000\0" \
60 "tftploc=/path/to/tftp/directory/\0" \
61 "nfs_root=/path/to/nfs/root\0" \
62 "tftptimeout=1000\0" \
63 "tftptimeoutcountmax=1000000\0" \
Tom Rini5ad8e112017-10-22 17:55:07 -040064 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Albert ARIBAUD \(3ADEV\)99208d92016-09-26 09:08:07 +020065 "bootargs_base=setenv bootargs rw " \
66 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020067 "console=ttyLP1,115200n8\0" \
68 "bootargs_sd=setenv bootargs ${bootargs} " \
69 "root=/dev/mmcblk0p2 rootwait\0" \
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +020070 "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020071 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \
72 "bootargs_nand=setenv bootargs ${bootargs} " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +020073 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020074 "bootargs_ram=setenv bootargs ${bootargs} " \
75 "root=/dev/ram rw initrd=${ram_addr}\0" \
76 "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
77 "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \
78 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \
79 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \
80 "bootz ${kernel_addr} - ${fdt_addr}\0" \
81 "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \
82 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \
83 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \
84 "bootz ${kernel_addr} - ${fdt_addr}\0" \
85 "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \
86 "nand read ${fdt_addr} dtb; " \
87 "nand read ${kernel_addr} kernel; " \
88 "bootz ${kernel_addr} - ${fdt_addr}\0" \
89 "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \
90 "nand read ${fdt_addr} dtb; " \
91 "nand read ${kernel_addr} kernel; " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +020092 "nand read ${ram_addr} root; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020093 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +020094 "update_bootloader_from_tftp=" PCM052_NET_INIT \
95 "if tftp ${blimg_addr} "\
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +020096 "${tftpdir}${blimg_file}; then " \
97 "mtdparts default; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +020098 "nand erase.part bootloader; " \
Albert ARIBAUD \(3ADEV\)2e9f4942016-09-26 09:08:06 +020099 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200100 "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \
101 "${kernel_file}; " \
102 "then mtdparts default; " \
103 "nand erase.part kernel; " \
104 "nand write ${kernel_addr} kernel ${filesize}; " \
105 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \
106 "nand erase.part dtb; " \
107 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200108 "update_kernel_from_tftp=" PCM052_NET_INIT \
109 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200110 "then setenv fdtsize ${filesize}; " \
111 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \
112 "mtdparts default; " \
113 "nand erase.part dtb; " \
114 "nand write ${fdt_addr} dtb ${fdtsize}; " \
115 "nand erase.part kernel; " \
116 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200117 "update_rootfs_from_tftp=" PCM052_NET_INIT \
118 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200119 "then mtdparts default; " \
120 "nand erase.part root; " \
121 "ubi part root; " \
122 "ubi create rootfs; " \
123 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \
Albert ARIBAUD \(3ADEV\)ddef3b62016-09-26 09:08:08 +0200124 "update_ramdisk_from_tftp=" PCM052_NET_INIT \
125 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \
Albert ARIBAUD (3ADEV)a3a095c2015-10-11 20:06:39 +0200126 "then mtdparts default; " \
Albert ARIBAUD \(3ADEV\)98585b42016-09-26 09:08:03 +0200127 "nand erase.part root; " \
128 "nand write ${ram_addr} root ${filesize}; fi\0"
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200129
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200130/* Miscellaneous configurable options */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200131
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200132/* Physical memory map */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200133#define PHYS_SDRAM (0x80000000)
Lukasz Majewskiec477ec2019-02-13 22:46:51 +0100134#define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * SZ_1M)
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200135
136#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
137#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
138#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
139
140#define CONFIG_SYS_INIT_SP_OFFSET \
141 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
142#define CONFIG_SYS_INIT_SP_ADDR \
143 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
144
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900145/* environment organization */
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200146
Albert ARIBAUD \(3ADEV\)26ffbef2015-09-21 22:43:39 +0200147#endif