1 /* 2 * Copyright (C) 2015, Savoir-faire Linux Inc. 3 * 4 * Derived from MX51EVK code by 5 * Guennadi Liakhovetski <lg@denx.de> 6 * Freescale Semiconductor, Inc. 7 * 8 * Configuration settings for the TS4800 Board 9 * 10 * SPDX-License-Identifier: GPL-2.0+ 11 */ 12 13 #ifndef __CONFIG_H 14 #define __CONFIG_H 15 16 /* High Level Configuration Options */ 17 #define CONFIG_MX51 18 19 #define CONFIG_SKIP_LOWLEVEL_INIT /* U-Boot is a 2nd stage bootloader */ 20 21 #define CONFIG_HW_WATCHDOG 22 23 #define CONFIG_MACH_TYPE MACH_TYPE_TS48XX 24 25 /* text base address used when linking */ 26 #define CONFIG_SYS_TEXT_BASE 0x90008000 27 28 #include <asm/arch/imx-regs.h> 29 30 /* enable passing of ATAGs */ 31 #define CONFIG_CMDLINE_TAG 32 #define CONFIG_SETUP_MEMORY_TAGS 33 #define CONFIG_INITRD_TAG 34 #define CONFIG_REVISION_TAG 35 36 /* 37 * Size of malloc() pool 38 */ 39 #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) 40 41 /* 42 * Hardware drivers 43 */ 44 45 #define CONFIG_MXC_UART 46 #define CONFIG_MXC_UART_BASE UART1_BASE 47 #define CONFIG_MXC_GPIO 48 49 /* 50 * SPI Configs 51 * */ 52 #define CONFIG_HARD_SPI /* puts SPI: ready */ 53 #define CONFIG_MXC_SPI /* driver for the SPI controllers*/ 54 55 /* 56 * MMC Configs 57 * */ 58 #define CONFIG_FSL_ESDHC 59 #define CONFIG_SYS_FSL_ESDHC_ADDR MMC_SDHC1_BASE_ADDR 60 61 /* 62 * Eth Configs 63 */ 64 #define CONFIG_MII 65 #define CONFIG_PHYLIB 66 #define CONFIG_PHY_SMSC 67 68 #define CONFIG_FEC_MXC 69 #define IMX_FEC_BASE FEC_BASE_ADDR 70 #define CONFIG_ETHPRIME "FEC" 71 #define CONFIG_FEC_MXC_PHYADDR 0 72 73 /* allow to overwrite serial and ethaddr */ 74 #define CONFIG_ENV_OVERWRITE /* disable vendor parameters protection (serial#, ethaddr) */ 75 #define CONFIG_CONS_INDEX 1 /* use UART0 : used by serial driver */ 76 #define CONFIG_BAUDRATE 115200 77 78 /*********************************************************** 79 * Command definition 80 ***********************************************************/ 81 82 /* Environment variables */ 83 84 85 #define CONFIG_LOADADDR 0x91000000 /* loadaddr env var */ 86 87 #define CONFIG_EXTRA_ENV_SETTINGS \ 88 "script=boot.scr\0" \ 89 "image=zImage\0" \ 90 "fdt_file=imx51-ts4800.dtb\0" \ 91 "fdt_addr=0x90fe0000\0" \ 92 "mmcdev=0\0" \ 93 "mmcpart=2\0" \ 94 "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \ 95 "mmcargs=setenv bootargs root=${mmcroot}\0" \ 96 "addtty=setenv bootargs ${bootargs} console=ttymxc0,${baudrate}\0" \ 97 "loadbootscript=" \ 98 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ 99 "bootscript=echo Running bootscript from mmc ...; " \ 100 "source\0" \ 101 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};\0" \ 102 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ 103 "mmcboot=echo Booting from mmc ...; " \ 104 "run mmcargs addtty; " \ 105 "if run loadfdt; then " \ 106 "bootz ${loadaddr} - ${fdt_addr}; " \ 107 "else " \ 108 "echo ERR: cannot load FDT; " \ 109 "fi; " 110 111 112 #define CONFIG_BOOTCOMMAND \ 113 "mmc dev ${mmcdev}; if mmc rescan; then " \ 114 "if run loadbootscript; then " \ 115 "run bootscript; " \ 116 "else " \ 117 "if run loadimage; then " \ 118 "run mmcboot; " \ 119 "fi; " \ 120 "fi; " \ 121 "fi; " 122 123 /* 124 * Miscellaneous configurable options 125 */ 126 #define CONFIG_SYS_LONGHELP /* undef to save memory */ 127 #define CONFIG_AUTO_COMPLETE 128 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ 129 /* Print Buffer Size */ 130 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) 131 #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ 132 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ 133 134 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 135 136 #define CONFIG_CMDLINE_EDITING 137 138 /*----------------------------------------------------------------------- 139 * Physical Memory Map 140 */ 141 #define CONFIG_NR_DRAM_BANKS 1 142 #define PHYS_SDRAM_1 CSD0_BASE_ADDR 143 #define PHYS_SDRAM_1_SIZE (256 * 1024 * 1024) 144 145 #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1) 146 #define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR) 147 #define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE) 148 149 #define CONFIG_SYS_INIT_SP_OFFSET \ 150 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 151 #define CONFIG_SYS_INIT_SP_ADDR \ 152 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 153 154 /* Low level init */ 155 #define CONFIG_SYS_DDR_CLKSEL 0 156 #define CONFIG_SYS_CLKTL_CBCDR 0x59E35100 157 #define CONFIG_SYS_MAIN_PWR_ON 158 159 /*----------------------------------------------------------------------- 160 * Environment organization 161 */ 162 163 #define CONFIG_ENV_OFFSET (6 * 64 * 1024) 164 #define CONFIG_ENV_SIZE (8 * 1024) 165 #define CONFIG_ENV_IS_IN_MMC 166 #define CONFIG_SYS_MMC_ENV_DEV 0 167 168 #endif 169