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