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