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