Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Logic PD, Inc. |
| 4 | * |
| 5 | * Configuration settings for the LogicPD i.MX6 SOM. |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __IMX6LOGIC_CONFIG_H |
| 9 | #define __IMX6LOGIC_CONFIG_H |
| 10 | |
Tom Rini | a17aa19 | 2022-12-04 10:04:55 -0500 | [diff] [blame] | 11 | #define CFG_MXC_UART_BASE UART1_BASE |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 12 | #define CONSOLE_DEV "ttymxc0" |
| 13 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 14 | #include "mx6_common.h" |
| 15 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 16 | /* MMC Configs */ |
Tom Rini | 376b88a | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 17 | #define CFG_SYS_FSL_ESDHC_ADDR 0 |
| 18 | #define CFG_SYS_FSL_USDHC_NUM 2 |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 19 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 20 | /* Ethernet Configs */ |
Tom Rini | 4e3c8a6 | 2022-12-04 10:03:53 -0500 | [diff] [blame] | 21 | #define CFG_FEC_MXC_PHYADDR 0 |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 22 | |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 23 | #define CFG_EXTRA_ENV_SETTINGS \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 24 | "script=boot.scr\0" \ |
| 25 | "image=zImage\0" \ |
| 26 | "bootm_size=0x10000000\0" \ |
Adam Ford | 4f28f69 | 2020-08-20 08:56:49 -0500 | [diff] [blame] | 27 | "fdt_addr_r=0x14000000\0" \ |
| 28 | "ramdisk_addr_r=0x14080000\0" \ |
Tom Rini | 9004ee0 | 2021-08-23 10:25:30 -0400 | [diff] [blame] | 29 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 30 | "ramdisk_file=rootfs.cpio.uboot\0" \ |
| 31 | "boot_fdt=try\0" \ |
| 32 | "ip_dyn=yes\0" \ |
| 33 | "console=" CONSOLE_DEV "\0" \ |
| 34 | "mmcdev=1\0" \ |
| 35 | "mmcpart=1\0" \ |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 36 | "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 37 | "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ |
| 38 | "mmcargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 39 | " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 40 | "nandargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 41 | " ubi.mtd=fs root=${nandroot} ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 42 | "ramargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 43 | " root=/dev/ram rw ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 44 | "loadbootscript=" \ |
| 45 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 46 | "bootscript=echo Running bootscript from mmc ...;" \ |
| 47 | " source\0" \ |
| 48 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \ |
| 49 | " setenv kernelsize ${filesize}\0" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 50 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \ |
| 51 | "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr_r}" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 52 | " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \ |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 53 | "mmcboot=echo Booting from mmc...; run finduuid; run mmcargs;" \ |
| 54 | "run loadimage; run loadfdt; bootz ${loadaddr} - ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 55 | "mmcramboot=run ramargs; run loadimage;" \ |
| 56 | " run loadfdt; run loadramdisk;" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 57 | " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 58 | "nandboot=echo Booting from nand ...; " \ |
| 59 | " run nandargs;" \ |
| 60 | " nand read ${loadaddr} kernel ${kernelsize};" \ |
Adam Ford | a732ec0 | 2019-02-16 14:09:45 -0600 | [diff] [blame] | 61 | " nand read ${fdt_addr_r} dtb;" \ |
| 62 | " bootz ${loadaddr} - ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 63 | "nandramboot=echo Booting RAMdisk from nand ...; " \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 64 | " nand read ${ramdisk_addr_r} fs ${ramdisksize};" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 65 | " nand read ${loadaddr} kernel ${kernelsize};" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 66 | " nand read ${fdt_addr_r} dtb;" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 67 | " run ramargs;" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 68 | " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 69 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
| 70 | "root=/dev/nfs" \ |
| 71 | " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 72 | "netboot=echo Booting from net ...; " \ |
| 73 | "run netargs; " \ |
| 74 | "if test ${ip_dyn} = yes; then " \ |
| 75 | "setenv get_cmd dhcp; " \ |
| 76 | "else " \ |
| 77 | "setenv get_cmd tftp; " \ |
| 78 | "fi; " \ |
| 79 | "${get_cmd} ${image}; " \ |
| 80 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
Adam Ford | a732ec0 | 2019-02-16 14:09:45 -0600 | [diff] [blame] | 81 | "if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \ |
| 82 | "bootz ${loadaddr} - ${fdt_addr_r}; " \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 83 | "else " \ |
| 84 | "if test ${boot_fdt} = try; then " \ |
| 85 | "bootz; " \ |
| 86 | "else " \ |
| 87 | "echo WARN: Cannot load the DT; " \ |
| 88 | "fi; " \ |
| 89 | "fi; " \ |
| 90 | "else " \ |
| 91 | "bootz; " \ |
| 92 | "fi;\0" \ |
| 93 | "autoboot=mmc dev ${mmcdev};" \ |
| 94 | "if mmc rescan; then " \ |
| 95 | "if run loadbootscript; then " \ |
| 96 | "run bootscript; " \ |
| 97 | "else " \ |
| 98 | "if run loadimage; then " \ |
| 99 | "run mmcboot; " \ |
| 100 | "else run netboot; " \ |
| 101 | "fi; " \ |
| 102 | "fi; " \ |
| 103 | "else run netboot; fi" |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 104 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 105 | /* Physical Memory Map */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 106 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 107 | #define CFG_SYS_SDRAM_BASE PHYS_SDRAM |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 108 | #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 109 | #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 110 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 111 | /* Environment organization */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 112 | |
| 113 | /* NAND stuff */ |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 114 | #define CFG_SYS_NAND_BASE 0x40000000 |
| 115 | #define CFG_SYS_NAND_U_BOOT_START CONFIG_TEXT_BASE |
Adam Ford | 01aa34b | 2019-01-12 17:24:52 -0600 | [diff] [blame] | 116 | |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 117 | /* Falcon Mode */ |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 118 | |
| 119 | /* Falcon Mode - MMC support: args@1MB kernel@2MB */ |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 120 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 121 | #endif /* __IMX6LOGIC_CONFIG_H */ |