1 /* 2 * Copyright (C) 2017 Logic PD, Inc. 3 * 4 * Configuration settings for the LogicPD i.MX6 SOM. 5 * 6 * SPDX-License-Identifier: GPL-2.0+ 7 */ 8 9 #ifndef __IMX6LOGIC_CONFIG_H 10 #define __IMX6LOGIC_CONFIG_H 11 12 #define CONFIG_MXC_UART_BASE UART1_BASE 13 #define CONSOLE_DEV "ttymxc0" 14 15 #include "mx6_common.h" 16 17 /* Size of malloc() pool */ 18 #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) 19 20 /* MMC Configs */ 21 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 22 #define CONFIG_SYS_FSL_USDHC_NUM 2 23 #define CONFIG_MMCROOT "/dev/mmcblk1p2" /* Dev kit SD card */ 24 25 /* Ethernet Configs */ 26 #define CONFIG_MII 27 #define CONFIG_FEC_XCV_TYPE RMII 28 #define CONFIG_ETHPRIME "FEC" 29 #define CONFIG_FEC_MXC_PHYADDR 0 30 31 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG 32 33 #define CONFIG_EXTRA_ENV_SETTINGS \ 34 "script=boot.scr\0" \ 35 "image=zImage\0" \ 36 "bootm_size=0x10000000\0" \ 37 "fdt_addr_r=0x18000000\0" \ 38 "fdt_addr=0x18000000\0" \ 39 "ramdisk_addr_r=0x13000000\0" \ 40 "ramdiskaddr=0x13000000\0" \ 41 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ 42 "ramdisk_file=rootfs.cpio.uboot\0" \ 43 "boot_fdt=try\0" \ 44 "ip_dyn=yes\0" \ 45 "console=" CONSOLE_DEV "\0" \ 46 "mmcdev=1\0" \ 47 "mmcpart=1\0" \ 48 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ 49 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ 50 "mmcargs=setenv bootargs console=${console},${baudrate}" \ 51 " root=${mmcroot} ${mtdparts}\0" \ 52 "nandargs=setenv bootargs console=${console},${baudrate}" \ 53 " ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \ 54 "ramargs=setenv bootargs console=${console},${baudrate}" \ 55 " root=/dev/ram rw ${mtdparts}\0" \ 56 "loadbootscript=" \ 57 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ 58 "bootscript=echo Running bootscript from mmc ...;" \ 59 " source\0" \ 60 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \ 61 " setenv kernelsize ${filesize}\0" \ 62 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ 63 "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \ 64 " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \ 65 "mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \ 66 " run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \ 67 "mmcramboot=run ramargs; run loadimage;" \ 68 " run loadfdt; run loadramdisk;" \ 69 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \ 70 "nandboot=echo Booting from nand ...; " \ 71 " run nandargs;" \ 72 " nand read ${loadaddr} kernel ${kernelsize};" \ 73 " nand read ${fdt_addr} dtb;" \ 74 " bootz ${loadaddr} - ${fdt_addr}\0" \ 75 "nandramboot=echo Booting RAMdisk from nand ...; " \ 76 " nand read ${ramdiskaddr} fs ${ramdisksize};" \ 77 " nand read ${loadaddr} kernel ${kernelsize};" \ 78 " nand read ${fdt_addr} dtb;" \ 79 " run ramargs;" \ 80 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \ 81 "netargs=setenv bootargs console=${console},${baudrate} " \ 82 "root=/dev/nfs" \ 83 " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ 84 "netboot=echo Booting from net ...; " \ 85 "run netargs; " \ 86 "if test ${ip_dyn} = yes; then " \ 87 "setenv get_cmd dhcp; " \ 88 "else " \ 89 "setenv get_cmd tftp; " \ 90 "fi; " \ 91 "${get_cmd} ${image}; " \ 92 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 93 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ 94 "bootz ${loadaddr} - ${fdt_addr}; " \ 95 "else " \ 96 "if test ${boot_fdt} = try; then " \ 97 "bootz; " \ 98 "else " \ 99 "echo WARN: Cannot load the DT; " \ 100 "fi; " \ 101 "fi; " \ 102 "else " \ 103 "bootz; " \ 104 "fi;\0" \ 105 "autoboot=mmc dev ${mmcdev};" \ 106 "if mmc rescan; then " \ 107 "if run loadbootscript; then " \ 108 "run bootscript; " \ 109 "else " \ 110 "if run loadimage; then " \ 111 "run mmcboot; " \ 112 "else run netboot; " \ 113 "fi; " \ 114 "fi; " \ 115 "else run netboot; fi" 116 #define CONFIG_BOOTCOMMAND \ 117 "run autoboot" 118 119 #define CONFIG_ARP_TIMEOUT 200UL 120 121 #define CONFIG_SYS_MEMTEST_START 0x10000000 122 #define CONFIG_SYS_MEMTEST_END 0x10010000 123 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 124 125 /* Physical Memory Map */ 126 #define CONFIG_NR_DRAM_BANKS 1 127 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 128 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 129 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 130 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 131 132 #define CONFIG_SYS_INIT_SP_OFFSET \ 133 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 134 #define CONFIG_SYS_INIT_SP_ADDR \ 135 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 136 137 /* Environment organization */ 138 #define CONFIG_ENV_SIZE (8 * 1024) 139 #define CONFIG_ENV_OFFSET 0x400000 140 #define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE 141 142 /* NAND stuff */ 143 #define CONFIG_SYS_MAX_NAND_DEVICE 1 144 #define CONFIG_SYS_NAND_BASE 0x40000000 145 #define CONFIG_SYS_NAND_5_ADDR_CYCLE 146 #define CONFIG_SYS_NAND_ONFI_DETECTION 147 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE 148 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000 149 150 /* MTD device */ 151 # define CONFIG_MTD_DEVICE 152 # define CONFIG_MTD_PARTITIONS 153 154 /* DMA stuff, needed for GPMI/MXS NAND support */ 155 156 /* EEPROM contains serial no, MAC addr and other Logic PD info */ 157 #define CONFIG_I2C_EEPROM 158 159 #endif /* __IMX6LOGIC_CONFIG_H */ 160