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