1 /* 2 * Freescale i.MX23 EVK board config 3 * 4 * Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br> 5 * on behalf of O.S. Systems Software LTDA. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * 21 */ 22 #ifndef __CONFIGS_MX23EVK_H__ 23 #define __CONFIGS_MX23EVK_H__ 24 25 /* System configurations */ 26 #define CONFIG_MX23 /* i.MX23 SoC */ 27 #define CONFIG_MACH_TYPE MACH_TYPE_MX23EVK 28 29 /* U-Boot Commands */ 30 #define CONFIG_SYS_NO_FLASH 31 #include <config_cmd_default.h> 32 #undef CONFIG_CMD_NET 33 #undef CONFIG_CMD_NFS 34 35 #define CONFIG_DISPLAY_CPUINFO 36 #define CONFIG_DOS_PARTITION 37 38 #define CONFIG_CMD_CACHE 39 #define CONFIG_CMD_EXT2 40 #define CONFIG_CMD_FAT 41 #define CONFIG_CMD_GPIO 42 #define CONFIG_CMD_MMC 43 #define CONFIG_CMD_USB 44 #define CONFIG_CMD_BOOTZ 45 #define CONFIG_VIDEO 46 47 /* Memory configuration */ 48 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ 49 #define PHYS_SDRAM_1 0x40000000 /* Base address */ 50 #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */ 51 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 52 53 /* Environment */ 54 #define CONFIG_ENV_OVERWRITE 55 #define CONFIG_ENV_IS_IN_MMC 56 57 /* Environment is in MMC */ 58 #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC) 59 #define CONFIG_ENV_OFFSET (256 * 1024) 60 #define CONFIG_ENV_SIZE (16 * 1024) 61 #define CONFIG_SYS_MMC_ENV_DEV 0 62 #endif 63 64 /* USB */ 65 #ifdef CONFIG_CMD_USB 66 #define CONFIG_EHCI_MXS_PORT0 67 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 68 #define CONFIG_USB_STORAGE 69 #endif 70 71 /* Framebuffer support */ 72 #ifdef CONFIG_VIDEO 73 #define CONFIG_VIDEO_LOGO 74 #define CONFIG_SPLASH_SCREEN 75 #define CONFIG_CMD_BMP 76 #define CONFIG_BMP_16BPP 77 #define CONFIG_VIDEO_BMP_RLE8 78 #define CONFIG_VIDEO_BMP_GZIP 79 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) 80 #endif 81 82 /* Boot Linux */ 83 #define CONFIG_BOOTDELAY 1 84 #define CONFIG_BOOTFILE "uImage" 85 #define CONFIG_LOADADDR 0x42000000 86 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 87 88 /* Extra Environments */ 89 #define CONFIG_EXTRA_ENV_SETTINGS \ 90 "update_sd_firmware_filename=u-boot.sd\0" \ 91 "update_sd_firmware=" /* Update the SD firmware partition */ \ 92 "if mmc rescan ; then " \ 93 "if tftp ${update_sd_firmware_filename} ; then " \ 94 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ 95 "setexpr fw_sz ${fw_sz} + 1 ; " \ 96 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ 97 "fi ; " \ 98 "fi\0" \ 99 "script=boot.scr\0" \ 100 "uimage=uImage\0" \ 101 "console=ttyAMA0\0" \ 102 "fdt_file=imx23-evk.dtb\0" \ 103 "fdt_addr=0x41000000\0" \ 104 "boot_fdt=try\0" \ 105 "mmcdev=0\0" \ 106 "mmcpart=2\0" \ 107 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ 108 "mmcargs=setenv bootargs console=${console},${baudrate} " \ 109 "root=${mmcroot}\0" \ 110 "loadbootscript=" \ 111 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ 112 "bootscript=echo Running bootscript from mmc ...; " \ 113 "source\0" \ 114 "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ 115 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ 116 "mmcboot=echo Booting from mmc ...; " \ 117 "run mmcargs; " \ 118 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 119 "if run loadfdt; then " \ 120 "bootm ${loadaddr} - ${fdt_addr}; " \ 121 "else " \ 122 "if test ${boot_fdt} = try; then " \ 123 "bootm; " \ 124 "else " \ 125 "echo WARN: Cannot load the DT; " \ 126 "fi; " \ 127 "fi; " \ 128 "else " \ 129 "bootm; " \ 130 "fi;\0" 131 132 #define CONFIG_BOOTCOMMAND \ 133 "mmc dev ${mmcdev}; if mmc rescan; then " \ 134 "if run loadbootscript; then " \ 135 "run bootscript; " \ 136 "else " \ 137 "if run loaduimage; then " \ 138 "run mmcboot; " \ 139 "else " \ 140 "echo ERR: Fail to boot from MMC; " \ 141 "fi; " \ 142 "fi; " \ 143 "else exit; fi" 144 145 /* The rest of the configuration is shared */ 146 #include <configs/mxs.h> 147 148 #endif /* __CONFIGS_MX23EVK_H__ */ 149