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 | |
| 20 | /* Size of malloc() pool */ |
| 21 | #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) |
| 22 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 23 | /* MMC Configs */ |
| 24 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 25 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 26 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 27 | |
| 28 | /* Ethernet Configs */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 29 | #define CONFIG_FEC_XCV_TYPE RMII |
| 30 | #define CONFIG_ETHPRIME "FEC" |
| 31 | #define CONFIG_FEC_MXC_PHYADDR 0 |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 32 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 33 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 34 | "script=boot.scr\0" \ |
| 35 | "image=zImage\0" \ |
| 36 | "bootm_size=0x10000000\0" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 37 | "fdt_addr_r=0x13000000\0" \ |
| 38 | "ramdisk_addr_r=0x14000000\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 39 | "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ |
| 40 | "ramdisk_file=rootfs.cpio.uboot\0" \ |
| 41 | "boot_fdt=try\0" \ |
| 42 | "ip_dyn=yes\0" \ |
| 43 | "console=" CONSOLE_DEV "\0" \ |
| 44 | "mmcdev=1\0" \ |
| 45 | "mmcpart=1\0" \ |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 46 | "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 47 | "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ |
| 48 | "mmcargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 49 | " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 50 | "nandargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 51 | " ubi.mtd=fs root=${nandroot} ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 52 | "ramargs=setenv bootargs console=${console},${baudrate}" \ |
Adam Ford | 3d37e62 | 2019-04-11 13:46:09 -0500 | [diff] [blame] | 53 | " root=/dev/ram rw ${mtdparts} ${optargs}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 54 | "loadbootscript=" \ |
| 55 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 56 | "bootscript=echo Running bootscript from mmc ...;" \ |
| 57 | " source\0" \ |
| 58 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \ |
| 59 | " setenv kernelsize ${filesize}\0" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 60 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \ |
| 61 | "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr_r}" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 62 | " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \ |
Adam Ford | fef998b | 2019-03-03 16:22:45 -0600 | [diff] [blame] | 63 | "mmcboot=echo Booting from mmc...; run finduuid; run mmcargs;" \ |
| 64 | "run loadimage; run loadfdt; bootz ${loadaddr} - ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 65 | "mmcramboot=run ramargs; run loadimage;" \ |
| 66 | " run loadfdt; run loadramdisk;" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 67 | " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 68 | "nandboot=echo Booting from nand ...; " \ |
| 69 | " run nandargs;" \ |
| 70 | " nand read ${loadaddr} kernel ${kernelsize};" \ |
Adam Ford | a732ec0 | 2019-02-16 14:09:45 -0600 | [diff] [blame] | 71 | " nand read ${fdt_addr_r} dtb;" \ |
| 72 | " bootz ${loadaddr} - ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 73 | "nandramboot=echo Booting RAMdisk from nand ...; " \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 74 | " nand read ${ramdisk_addr_r} fs ${ramdisksize};" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 75 | " nand read ${loadaddr} kernel ${kernelsize};" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 76 | " nand read ${fdt_addr_r} dtb;" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 77 | " run ramargs;" \ |
Adam Ford | 886d234 | 2018-07-20 08:25:53 -0500 | [diff] [blame] | 78 | " bootz ${loadaddr} ${ramdisk_addr_r} ${fdt_addr_r}\0" \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 79 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
| 80 | "root=/dev/nfs" \ |
| 81 | " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 82 | "netboot=echo Booting from net ...; " \ |
| 83 | "run netargs; " \ |
| 84 | "if test ${ip_dyn} = yes; then " \ |
| 85 | "setenv get_cmd dhcp; " \ |
| 86 | "else " \ |
| 87 | "setenv get_cmd tftp; " \ |
| 88 | "fi; " \ |
| 89 | "${get_cmd} ${image}; " \ |
| 90 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
Adam Ford | a732ec0 | 2019-02-16 14:09:45 -0600 | [diff] [blame] | 91 | "if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \ |
| 92 | "bootz ${loadaddr} - ${fdt_addr_r}; " \ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 93 | "else " \ |
| 94 | "if test ${boot_fdt} = try; then " \ |
| 95 | "bootz; " \ |
| 96 | "else " \ |
| 97 | "echo WARN: Cannot load the DT; " \ |
| 98 | "fi; " \ |
| 99 | "fi; " \ |
| 100 | "else " \ |
| 101 | "bootz; " \ |
| 102 | "fi;\0" \ |
| 103 | "autoboot=mmc dev ${mmcdev};" \ |
| 104 | "if mmc rescan; then " \ |
| 105 | "if run loadbootscript; then " \ |
| 106 | "run bootscript; " \ |
| 107 | "else " \ |
| 108 | "if run loadimage; then " \ |
| 109 | "run mmcboot; " \ |
| 110 | "else run netboot; " \ |
| 111 | "fi; " \ |
| 112 | "fi; " \ |
| 113 | "else run netboot; fi" |
| 114 | #define CONFIG_BOOTCOMMAND \ |
| 115 | "run autoboot" |
| 116 | |
| 117 | #define CONFIG_ARP_TIMEOUT 200UL |
| 118 | |
| 119 | #define CONFIG_SYS_MEMTEST_START 0x10000000 |
| 120 | #define CONFIG_SYS_MEMTEST_END 0x10010000 |
| 121 | #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 |
| 122 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 123 | /* Physical Memory Map */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 124 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 125 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 126 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 127 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 128 | |
| 129 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 130 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 131 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 132 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 133 | |
| 134 | /* Environment organization */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 135 | |
| 136 | /* NAND stuff */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 137 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 138 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 139 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 140 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 141 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 142 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000 |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 143 | #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00500000 |
Adam Ford | 01aa34b | 2019-01-12 17:24:52 -0600 | [diff] [blame] | 144 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 145 | /* MTD device */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 146 | |
| 147 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 148 | |
| 149 | /* EEPROM contains serial no, MAC addr and other Logic PD info */ |
| 150 | #define CONFIG_I2C_EEPROM |
| 151 | |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 152 | /* USB Configs */ |
| 153 | #ifdef CONFIG_CMD_USB |
| 154 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 155 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 156 | #define CONFIG_MXC_USB_FLAGS 0 |
| 157 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Enabled USB controller number */ |
| 158 | #endif |
| 159 | |
| 160 | /* Falcon Mode */ |
| 161 | #define CONFIG_SPL_FS_LOAD_ARGS_NAME "args" |
| 162 | #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage" |
Adam Ford | 01aa34b | 2019-01-12 17:24:52 -0600 | [diff] [blame] | 163 | #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000 |
Adam Ford | 1b54699 | 2018-07-05 20:58:24 -0500 | [diff] [blame] | 164 | |
| 165 | /* Falcon Mode - MMC support: args@1MB kernel@2MB */ |
| 166 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */ |
| 167 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) |
| 168 | #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */ |
| 169 | |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 170 | #endif /* __IMX6LOGIC_CONFIG_H */ |