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