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