uboot/include/configs/m28evk.h
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
   3 * on behalf of DENX Software Engineering GmbH
   4 *
   5 * SPDX-License-Identifier:     GPL-2.0+
   6 */
   7#ifndef __CONFIGS_M28EVK_H__
   8#define __CONFIGS_M28EVK_H__
   9
  10/* System configurations */
  11#define CONFIG_MX28                             /* i.MX28 SoC */
  12#define MACH_TYPE_M28EVK        3613
  13#define CONFIG_MACH_TYPE        MACH_TYPE_M28EVK
  14
  15#define CONFIG_TIMESTAMP                /* Print image info with timestamp */
  16
  17/* U-Boot Commands */
  18#define CONFIG_SYS_NO_FLASH
  19#define CONFIG_DISPLAY_CPUINFO
  20#define CONFIG_DOS_PARTITION
  21#define CONFIG_FAT_WRITE
  22
  23#define CONFIG_CMD_BMP
  24#define CONFIG_CMD_DATE
  25#define CONFIG_CMD_EEPROM
  26#define CONFIG_CMD_NAND
  27#define CONFIG_CMD_NAND_TRIMFFS
  28#define CONFIG_VIDEO
  29
  30/* Memory configuration */
  31#define CONFIG_NR_DRAM_BANKS            1               /* 1 bank of DRAM */
  32#define PHYS_SDRAM_1                    0x40000000      /* Base address */
  33#define PHYS_SDRAM_1_SIZE               0x20000000      /* Max 512 MB RAM */
  34#define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
  35
  36/* Environment */
  37#define CONFIG_ENV_SIZE                 (16 * 1024)
  38#define CONFIG_ENV_IS_IN_NAND
  39
  40/* Environment is in NAND */
  41#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
  42#define CONFIG_ENV_SIZE_REDUND          CONFIG_ENV_SIZE
  43#define CONFIG_ENV_SECT_SIZE            (128 * 1024)
  44#define CONFIG_ENV_RANGE                (4 * CONFIG_ENV_SECT_SIZE)
  45#define CONFIG_ENV_OFFSET               (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
  46#define CONFIG_ENV_OFFSET_REDUND        \
  47                (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
  48
  49#define CONFIG_CMD_UBI
  50#define CONFIG_CMD_UBIFS
  51#define CONFIG_CMD_MTDPARTS
  52#define CONFIG_RBTREE
  53#define CONFIG_LZO
  54#define CONFIG_MTD_DEVICE
  55#define CONFIG_MTD_PARTITIONS
  56#define MTDIDS_DEFAULT                  "nand0=gpmi-nand"
  57#define MTDPARTS_DEFAULT                        \
  58        "mtdparts=gpmi-nand:"                   \
  59                "3m(u-boot),"                   \
  60                "512k(env1),"                   \
  61                "512k(env2),"                   \
  62                "14m(boot),"                    \
  63                "238m(data),"                   \
  64                "-@4096k(UBI)"
  65#else
  66#define CONFIG_ENV_IS_NOWHERE
  67#endif
  68
  69/* FEC Ethernet on SoC */
  70#ifdef CONFIG_CMD_NET
  71#define CONFIG_FEC_MXC
  72#endif
  73
  74/* EEPROM */
  75#ifdef CONFIG_CMD_EEPROM
  76#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
  77#endif
  78
  79/* RTC */
  80#ifdef CONFIG_CMD_DATE
  81/* Use the internal RTC in the MXS chip */
  82#define CONFIG_RTC_INTERNAL
  83#ifdef CONFIG_RTC_INTERNAL
  84#define CONFIG_RTC_MXS
  85#else
  86#define CONFIG_RTC_M41T62
  87#define CONFIG_SYS_I2C_RTC_ADDR         0x68
  88#define CONFIG_SYS_M41T11_BASE_YEAR     2000
  89#endif
  90#endif
  91
  92/* USB */
  93#ifdef CONFIG_CMD_USB
  94#define CONFIG_EHCI_MXS_PORT0
  95#define CONFIG_EHCI_MXS_PORT1
  96#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
  97#endif
  98
  99/* SPI */
 100#ifdef CONFIG_CMD_SPI
 101#define CONFIG_DEFAULT_SPI_BUS          2
 102#define CONFIG_DEFAULT_SPI_CS           0
 103#define CONFIG_DEFAULT_SPI_MODE         SPI_MODE_0
 104
 105/* SPI FLASH */
 106#ifdef CONFIG_CMD_SF
 107#define CONFIG_SF_DEFAULT_BUS           2
 108#define CONFIG_SF_DEFAULT_CS            0
 109#define CONFIG_SF_DEFAULT_SPEED         40000000
 110#define CONFIG_SF_DEFAULT_MODE          SPI_MODE_0
 111
 112#define CONFIG_ENV_SPI_BUS              2
 113#define CONFIG_ENV_SPI_CS               0
 114#define CONFIG_ENV_SPI_MAX_HZ           40000000
 115#define CONFIG_ENV_SPI_MODE             SPI_MODE_0
 116#endif
 117
 118#endif
 119
 120/* LCD */
 121#ifdef CONFIG_VIDEO
 122#define CONFIG_VIDEO_LOGO
 123#define CONFIG_SPLASH_SCREEN
 124#define CONFIG_CMD_BMP
 125#define CONFIG_BMP_16BPP
 126#define CONFIG_VIDEO_BMP_RLE8
 127#define CONFIG_VIDEO_BMP_GZIP
 128#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  (2 << 20)
 129#endif
 130
 131/* Booting Linux */
 132#define CONFIG_BOOTFILE         "fitImage"
 133#define CONFIG_BOOTARGS         "console=ttyAMA0,115200n8 "
 134#define CONFIG_BOOTCOMMAND      "run mmc_mmc"
 135#define CONFIG_LOADADDR         0x42000000
 136#define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
 137
 138/* Extra Environment */
 139#define CONFIG_PREBOOT          "run try_bootscript"
 140#define CONFIG_HOSTNAME         m28evk
 141
 142#define CONFIG_EXTRA_ENV_SETTINGS                                       \
 143        "consdev=ttyAMA0\0"                                             \
 144        "baudrate=115200\0"                                             \
 145        "bootscript=boot.scr\0"                                         \
 146        "bootdev=/dev/mmcblk0p2\0"                                      \
 147        "rootdev=/dev/mmcblk0p3\0"                                      \
 148        "netdev=eth0\0"                                                 \
 149        "hostname=m28evk\0"                                             \
 150        "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0"               \
 151        "kernel_addr_r=0x42000000\0"                                    \
 152        "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066,"  \
 153                "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296,"      \
 154                "vmode:0\0"                                             \
 155        "update_nand_full_filename=u-boot.nand\0"                       \
 156        "update_nand_firmware_filename=u-boot.sb\0"                     \
 157        "update_sd_firmware_filename=u-boot.sd\0"                       \
 158        "update_nand_firmware_maxsz=0x100000\0"                         \
 159        "update_nand_stride=0x40\0"     /* MX28 datasheet ch. 12.12 */  \
 160        "update_nand_count=0x4\0"       /* MX28 datasheet ch. 12.12 */  \
 161        "update_nand_get_fcb_size="     /* Get size of FCB blocks */    \
 162                "nand device 0 ; "                                      \
 163                "nand info ; "                                          \
 164                "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
 165                "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
 166        "update_nand_full="             /* Update FCB, DBBT and FW */   \
 167                "if tftp ${update_nand_full_filename} ; then "          \
 168                "run update_nand_get_fcb_size ; "                       \
 169                "nand scrub -y 0x0 ${filesize} ; "                      \
 170                "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "           \
 171                "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
 172                "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
 173                "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
 174                "fi\0"                                                  \
 175        "update_nand_firmware="         /* Update only firmware */      \
 176                "if tftp ${update_nand_firmware_filename} ; then "      \
 177                "run update_nand_get_fcb_size ; "                       \
 178                "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
 179                "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; "    \
 180                "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
 181                "nand erase ${fcb_sz} ${fw_sz} ; "                      \
 182                "nand write ${loadaddr} ${fcb_sz} ${filesize} ; "       \
 183                "nand write ${loadaddr} ${fw_off} ${filesize} ; "       \
 184                "fi\0"                                                  \
 185        "update_sd_firmware="           /* Update the SD firmware partition */ \
 186                "if mmc rescan ; then "                                 \
 187                "if tftp ${update_sd_firmware_filename} ; then "        \
 188                "setexpr fw_sz ${filesize} / 0x200 ; "  /* SD block size */ \
 189                "setexpr fw_sz ${fw_sz} + 1 ; "                         \
 190                "mmc write ${loadaddr} 0x800 ${fw_sz} ; "               \
 191                "fi ; "                                                 \
 192                "fi\0"                                                  \
 193        "addcons="                                                      \
 194                "setenv bootargs ${bootargs} "                          \
 195                "console=${consdev},${baudrate}\0"                      \
 196        "addip="                                                        \
 197                "setenv bootargs ${bootargs} "                          \
 198                "ip=${ipaddr}:${serverip}:${gatewayip}:"                \
 199                        "${netmask}:${hostname}:${netdev}:off\0"        \
 200        "addmisc="                                                      \
 201                "setenv bootargs ${bootargs} ${miscargs}\0"             \
 202        "adddfltmtd="                                                   \
 203                "if test \"x${mtdparts}\" == \"x\" ; then "             \
 204                        "mtdparts default ; "                           \
 205                "fi\0"                                                  \
 206        "addmtd="                                                       \
 207                "run adddfltmtd ; "                                     \
 208                "setenv bootargs ${bootargs} ${mtdparts}\0"             \
 209        "addargs=run addcons addmtd addmisc\0"                          \
 210        "mmcload="                                                      \
 211                "mmc rescan ; "                                         \
 212                "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"           \
 213        "ubiload="                                                      \
 214                "ubi part UBI ; ubifsmount ubi0:rootfs ; "              \
 215                "ubifsload ${kernel_addr_r} /boot/${bootfile}\0"        \
 216        "netload="                                                      \
 217                "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"       \
 218        "miscargs=nohlt panic=1\0"                                      \
 219        "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0"         \
 220        "ubiargs="                                                      \
 221                "setenv bootargs ubi.mtd=5 "                            \
 222                "root=ubi0:rootfs rootfstype=ubifs\0"                   \
 223        "nfsargs="                                                      \
 224                "setenv bootargs root=/dev/nfs rw "                     \
 225                        "nfsroot=${serverip}:${rootpath},v3,tcp\0"      \
 226        "mmc_mmc="                                                      \
 227                "run mmcload mmcargs addargs ; "                        \
 228                "bootm ${kernel_addr_r}\0"                              \
 229        "mmc_ubi="                                                      \
 230                "run mmcload ubiargs addargs ; "                        \
 231                "bootm ${kernel_addr_r}\0"                              \
 232        "mmc_nfs="                                                      \
 233                "run mmcload nfsargs addip addargs ; "                  \
 234                "bootm ${kernel_addr_r}\0"                              \
 235        "ubi_mmc="                                                      \
 236                "run ubiload mmcargs addargs ; "                        \
 237                "bootm ${kernel_addr_r}\0"                              \
 238        "ubi_ubi="                                                      \
 239                "run ubiload ubiargs addargs ; "                        \
 240                "bootm ${kernel_addr_r}\0"                              \
 241        "ubi_nfs="                                                      \
 242                "run ubiload nfsargs addip addargs ; "                  \
 243                "bootm ${kernel_addr_r}\0"                              \
 244        "net_mmc="                                                      \
 245                "run netload mmcargs addargs ; "                        \
 246                "bootm ${kernel_addr_r}\0"                              \
 247        "net_ubi="                                                      \
 248                "run netload ubiargs addargs ; "                        \
 249                "bootm ${kernel_addr_r}\0"                              \
 250        "net_nfs="                                                      \
 251                "run netload nfsargs addip addargs ; "                  \
 252                "bootm ${kernel_addr_r}\0"                              \
 253        "try_bootscript="                                               \
 254                "mmc rescan;"                                           \
 255                "if test -e mmc 0:2 ${bootscript} ; then "              \
 256                "if load mmc 0:2 ${kernel_addr_r} ${bootscript};"       \
 257                "then ; "                                               \
 258                        "echo Running bootscript... ; "                 \
 259                        "source ${kernel_addr_r} ; "                    \
 260                "fi ; "                                                 \
 261                "fi\0"
 262
 263/* The rest of the configuration is shared */
 264#include <configs/mxs.h>
 265
 266#endif /* __CONFIGS_M28EVK_H__ */
 267