Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2013 Freescale Semiconductor, Inc. |
| 4 | * |
| 5 | * Configuration settings for the phytec PCM-052 SoM. |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_H |
| 9 | #define __CONFIG_H |
| 10 | |
| 11 | #include <asm/arch/imx-regs.h> |
Lukasz Majewski | 8d91740 | 2019-02-13 22:46:51 +0100 | [diff] [blame] | 12 | #include <linux/sizes.h> |
Simon Glass | 1af3c7f | 2020-05-10 11:40:09 -0600 | [diff] [blame] | 13 | #include <linux/stringify.h> |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 14 | |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 15 | /* NAND support */ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 16 | |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 17 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 18 | |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 19 | /* if no target-specific extra environment settings were defined by the |
| 20 | target, define an empty one */ |
| 21 | #ifndef PCM052_EXTRA_ENV_SETTINGS |
| 22 | #define PCM052_EXTRA_ENV_SETTINGS |
| 23 | #endif |
| 24 | |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 25 | /* if no target-specific extra environment settings were defined by the |
| 26 | target, define an empty one */ |
| 27 | #ifndef PCM052_NET_INIT |
| 28 | #define PCM052_NET_INIT |
| 29 | #endif |
| 30 | |
| 31 | /* boot command, including the target-defined one if any */ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 32 | |
| 33 | /* Extra env settings (including the target-defined ones if any) */ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 34 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 35 | PCM052_EXTRA_ENV_SETTINGS \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 36 | "fdt_high=0xffffffff\0" \ |
| 37 | "initrd_high=0xffffffff\0" \ |
Albert ARIBAUD \(3ADEV\) | ed0c2c0 | 2016-09-26 09:08:06 +0200 | [diff] [blame] | 38 | "blimg_file=u-boot.vyb\0" \ |
| 39 | "blimg_addr=0x81000000\0" \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 40 | "kernel_file=zImage\0" \ |
| 41 | "kernel_addr=0x82000000\0" \ |
Albert ARIBAUD \(3ADEV\) | 083e4fd | 2016-09-26 09:08:04 +0200 | [diff] [blame] | 42 | "fdt_file=zImage.dtb\0" \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 43 | "fdt_addr=0x81000000\0" \ |
| 44 | "ram_file=uRamdisk\0" \ |
| 45 | "ram_addr=0x83000000\0" \ |
| 46 | "filesys=rootfs.ubifs\0" \ |
| 47 | "sys_addr=0x81000000\0" \ |
| 48 | "tftploc=/path/to/tftp/directory/\0" \ |
| 49 | "nfs_root=/path/to/nfs/root\0" \ |
| 50 | "tftptimeout=1000\0" \ |
| 51 | "tftptimeoutcountmax=1000000\0" \ |
Albert ARIBAUD \(3ADEV\) | a7e5f7f | 2016-09-26 09:08:07 +0200 | [diff] [blame] | 52 | "bootargs_base=setenv bootargs rw " \ |
| 53 | " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 54 | "console=ttyLP1,115200n8\0" \ |
| 55 | "bootargs_sd=setenv bootargs ${bootargs} " \ |
| 56 | "root=/dev/mmcblk0p2 rootwait\0" \ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 57 | "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 58 | "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \ |
| 59 | "bootargs_nand=setenv bootargs ${bootargs} " \ |
Albert ARIBAUD \(3ADEV\) | 27f7d4f | 2016-09-26 09:08:03 +0200 | [diff] [blame] | 60 | "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 61 | "bootargs_ram=setenv bootargs ${bootargs} " \ |
| 62 | "root=/dev/ram rw initrd=${ram_addr}\0" \ |
| 63 | "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 64 | "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \ |
| 65 | "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \ |
| 66 | "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \ |
| 67 | "bootz ${kernel_addr} - ${fdt_addr}\0" \ |
| 68 | "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \ |
| 69 | "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \ |
| 70 | "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \ |
| 71 | "bootz ${kernel_addr} - ${fdt_addr}\0" \ |
| 72 | "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \ |
| 73 | "nand read ${fdt_addr} dtb; " \ |
| 74 | "nand read ${kernel_addr} kernel; " \ |
| 75 | "bootz ${kernel_addr} - ${fdt_addr}\0" \ |
| 76 | "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \ |
| 77 | "nand read ${fdt_addr} dtb; " \ |
| 78 | "nand read ${kernel_addr} kernel; " \ |
Albert ARIBAUD \(3ADEV\) | 27f7d4f | 2016-09-26 09:08:03 +0200 | [diff] [blame] | 79 | "nand read ${ram_addr} root; " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 80 | "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 81 | "update_bootloader_from_tftp=" PCM052_NET_INIT \ |
| 82 | "if tftp ${blimg_addr} "\ |
Albert ARIBAUD \(3ADEV\) | ed0c2c0 | 2016-09-26 09:08:06 +0200 | [diff] [blame] | 83 | "${tftpdir}${blimg_file}; then " \ |
| 84 | "mtdparts default; " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 85 | "nand erase.part bootloader; " \ |
Albert ARIBAUD \(3ADEV\) | ed0c2c0 | 2016-09-26 09:08:06 +0200 | [diff] [blame] | 86 | "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 87 | "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \ |
| 88 | "${kernel_file}; " \ |
| 89 | "then mtdparts default; " \ |
| 90 | "nand erase.part kernel; " \ |
| 91 | "nand write ${kernel_addr} kernel ${filesize}; " \ |
| 92 | "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \ |
| 93 | "nand erase.part dtb; " \ |
| 94 | "nand write ${fdt_addr} dtb ${filesize}; fi\0" \ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 95 | "update_kernel_from_tftp=" PCM052_NET_INIT \ |
| 96 | "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 97 | "then setenv fdtsize ${filesize}; " \ |
| 98 | "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \ |
| 99 | "mtdparts default; " \ |
| 100 | "nand erase.part dtb; " \ |
| 101 | "nand write ${fdt_addr} dtb ${fdtsize}; " \ |
| 102 | "nand erase.part kernel; " \ |
| 103 | "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 104 | "update_rootfs_from_tftp=" PCM052_NET_INIT \ |
| 105 | "if tftp ${sys_addr} ${tftpdir}${filesys}; " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 106 | "then mtdparts default; " \ |
| 107 | "nand erase.part root; " \ |
| 108 | "ubi part root; " \ |
| 109 | "ubi create rootfs; " \ |
| 110 | "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \ |
Albert ARIBAUD \(3ADEV\) | 27192d1 | 2016-09-26 09:08:08 +0200 | [diff] [blame] | 111 | "update_ramdisk_from_tftp=" PCM052_NET_INIT \ |
| 112 | "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \ |
Albert ARIBAUD (3ADEV) | 040ef8f | 2015-10-11 20:06:39 +0200 | [diff] [blame] | 113 | "then mtdparts default; " \ |
Albert ARIBAUD \(3ADEV\) | 27f7d4f | 2016-09-26 09:08:03 +0200 | [diff] [blame] | 114 | "nand erase.part root; " \ |
| 115 | "nand write ${ram_addr} root ${filesize}; fi\0" |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 116 | |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 117 | /* Miscellaneous configurable options */ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 118 | |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 119 | /* Physical memory map */ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 120 | #define PHYS_SDRAM (0x80000000) |
Lukasz Majewski | 8d91740 | 2019-02-13 22:46:51 +0100 | [diff] [blame] | 121 | #define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * SZ_1M) |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 122 | |
| 123 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 124 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 125 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 126 | |
Masahiro Yamada | e856bdc | 2017-02-11 22:43:54 +0900 | [diff] [blame] | 127 | /* environment organization */ |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 128 | |
Albert ARIBAUD \(3ADEV\) | 931a1d2 | 2015-09-21 22:43:39 +0200 | [diff] [blame] | 129 | #endif |