2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2011-11-08 23:18:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
|
|
|
|
* on behalf of DENX Software Engineering GmbH
|
|
|
|
*/
|
2013-06-16 13:39:02 +00:00
|
|
|
#ifndef __CONFIGS_M28EVK_H__
|
|
|
|
#define __CONFIGS_M28EVK_H__
|
2011-11-08 23:18:20 +00:00
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* System configurations */
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
|
2011-11-08 23:18:20 +00:00
|
|
|
|
2014-06-26 09:01:27 +00:00
|
|
|
#define CONFIG_TIMESTAMP /* Print image info with timestamp */
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* Memory configuration */
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
|
|
|
|
#define PHYS_SDRAM_1 0x40000000 /* Base address */
|
|
|
|
#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
|
|
|
|
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
|
2011-11-08 23:18:20 +00:00
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* Environment */
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_ENV_SIZE (16 * 1024)
|
2011-11-08 23:18:20 +00:00
|
|
|
|
|
|
|
/* Environment is in NAND */
|
2013-06-16 13:39:02 +00:00
|
|
|
#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
|
|
|
|
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
|
2014-06-26 09:01:28 +00:00
|
|
|
#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
|
|
|
|
#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_ENV_OFFSET_REDUND \
|
2011-11-08 23:18:20 +00:00
|
|
|
(CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
|
|
|
|
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_MTD_DEVICE
|
|
|
|
#define CONFIG_MTD_PARTITIONS
|
2011-11-08 23:18:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* FEC Ethernet on SoC */
|
|
|
|
#ifdef CONFIG_CMD_NET
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_FEC_MXC
|
2011-11-08 23:18:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* RTC */
|
|
|
|
#ifdef CONFIG_CMD_DATE
|
2011-11-08 23:18:20 +00:00
|
|
|
/* Use the internal RTC in the MXS chip */
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_RTC_INTERNAL
|
2013-06-16 13:39:02 +00:00
|
|
|
#ifdef CONFIG_RTC_INTERNAL
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_RTC_MXS
|
2011-11-08 23:18:20 +00:00
|
|
|
#else
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_RTC_M41T62
|
|
|
|
#define CONFIG_SYS_I2C_RTC_ADDR 0x68
|
|
|
|
#define CONFIG_SYS_M41T11_BASE_YEAR 2000
|
2011-11-08 23:18:20 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* USB */
|
|
|
|
#ifdef CONFIG_CMD_USB
|
2013-02-23 02:43:02 +00:00
|
|
|
#define CONFIG_EHCI_MXS_PORT0
|
|
|
|
#define CONFIG_EHCI_MXS_PORT1
|
|
|
|
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
|
2011-11-08 23:18:27 +00:00
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* SPI */
|
|
|
|
#ifdef CONFIG_CMD_SPI
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_DEFAULT_SPI_BUS 2
|
|
|
|
#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
|
2011-11-08 23:18:20 +00:00
|
|
|
|
|
|
|
/* SPI FLASH */
|
2013-06-16 13:39:02 +00:00
|
|
|
#ifdef CONFIG_CMD_SF
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_SF_DEFAULT_BUS 2
|
|
|
|
#define CONFIG_SF_DEFAULT_CS 0
|
|
|
|
#define CONFIG_SF_DEFAULT_SPEED 40000000
|
|
|
|
#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
|
2011-11-08 23:18:20 +00:00
|
|
|
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_ENV_SPI_BUS 2
|
|
|
|
#define CONFIG_ENV_SPI_CS 0
|
|
|
|
#define CONFIG_ENV_SPI_MAX_HZ 40000000
|
|
|
|
#define CONFIG_ENV_SPI_MODE SPI_MODE_0
|
2011-11-08 23:18:20 +00:00
|
|
|
#endif
|
2013-06-16 13:39:02 +00:00
|
|
|
|
2011-11-08 23:18:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* LCD */
|
|
|
|
#ifdef CONFIG_VIDEO
|
2013-04-28 09:20:04 +00:00
|
|
|
#define CONFIG_VIDEO_LOGO
|
|
|
|
#define CONFIG_SPLASH_SCREEN
|
|
|
|
#define CONFIG_BMP_16BPP
|
|
|
|
#define CONFIG_VIDEO_BMP_RLE8
|
|
|
|
#define CONFIG_VIDEO_BMP_GZIP
|
2014-06-26 09:01:27 +00:00
|
|
|
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
|
2013-04-28 09:20:04 +00:00
|
|
|
#endif
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* Booting Linux */
|
2014-06-26 09:01:29 +00:00
|
|
|
#define CONFIG_BOOTFILE "fitImage"
|
|
|
|
#define CONFIG_BOOTCOMMAND "run mmc_mmc"
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_LOADADDR 0x42000000
|
|
|
|
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
|
2011-11-08 23:18:20 +00:00
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* Extra Environment */
|
2014-06-26 09:01:29 +00:00
|
|
|
#define CONFIG_PREBOOT "run try_bootscript"
|
2018-03-28 12:38:20 +00:00
|
|
|
#define CONFIG_HOSTNAME "m28evk"
|
2014-06-26 09:01:29 +00:00
|
|
|
|
2013-03-23 23:50:35 +00:00
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
2014-06-26 09:01:29 +00:00
|
|
|
"consdev=ttyAMA0\0" \
|
|
|
|
"baudrate=115200\0" \
|
2014-10-11 22:00:50 +00:00
|
|
|
"bootscript=boot.scr\0" \
|
2014-06-26 09:01:29 +00:00
|
|
|
"bootdev=/dev/mmcblk0p2\0" \
|
|
|
|
"rootdev=/dev/mmcblk0p3\0" \
|
|
|
|
"netdev=eth0\0" \
|
|
|
|
"hostname=m28evk\0" \
|
|
|
|
"rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
|
|
|
|
"kernel_addr_r=0x42000000\0" \
|
|
|
|
"videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
|
|
|
|
"le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
|
|
|
|
"vmode:0\0" \
|
2011-11-08 23:18:20 +00:00
|
|
|
"update_nand_full_filename=u-boot.nand\0" \
|
|
|
|
"update_nand_firmware_filename=u-boot.sb\0" \
|
2012-05-01 11:09:43 +00:00
|
|
|
"update_sd_firmware_filename=u-boot.sd\0" \
|
2011-11-08 23:18:20 +00:00
|
|
|
"update_nand_firmware_maxsz=0x100000\0" \
|
|
|
|
"update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
|
|
|
|
"update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
|
|
|
|
"update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
|
|
|
|
"nand device 0 ; " \
|
|
|
|
"nand info ; " \
|
|
|
|
"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
|
|
|
|
"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
|
|
|
|
"update_nand_full=" /* Update FCB, DBBT and FW */ \
|
|
|
|
"if tftp ${update_nand_full_filename} ; then " \
|
|
|
|
"run update_nand_get_fcb_size ; " \
|
|
|
|
"nand scrub -y 0x0 ${filesize} ; " \
|
2014-06-26 09:01:29 +00:00
|
|
|
"nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
|
2011-11-08 23:18:20 +00:00
|
|
|
"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
|
|
|
|
"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
|
|
|
|
"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
|
|
|
|
"fi\0" \
|
|
|
|
"update_nand_firmware=" /* Update only firmware */ \
|
|
|
|
"if tftp ${update_nand_firmware_filename} ; then " \
|
|
|
|
"run update_nand_get_fcb_size ; " \
|
|
|
|
"setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
|
|
|
|
"setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
|
|
|
|
"setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
|
|
|
|
"nand erase ${fcb_sz} ${fw_sz} ; " \
|
|
|
|
"nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
|
|
|
|
"nand write ${loadaddr} ${fw_off} ${filesize} ; " \
|
2012-05-01 11:09:43 +00:00
|
|
|
"fi\0" \
|
|
|
|
"update_sd_firmware=" /* Update the SD firmware partition */ \
|
|
|
|
"if mmc rescan ; then " \
|
|
|
|
"if tftp ${update_sd_firmware_filename} ; then " \
|
|
|
|
"setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
|
|
|
|
"setexpr fw_sz ${fw_sz} + 1 ; " \
|
|
|
|
"mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
|
|
|
|
"fi ; " \
|
2014-06-26 09:01:29 +00:00
|
|
|
"fi\0" \
|
|
|
|
"addcons=" \
|
|
|
|
"setenv bootargs ${bootargs} " \
|
|
|
|
"console=${consdev},${baudrate}\0" \
|
|
|
|
"addip=" \
|
|
|
|
"setenv bootargs ${bootargs} " \
|
|
|
|
"ip=${ipaddr}:${serverip}:${gatewayip}:" \
|
|
|
|
"${netmask}:${hostname}:${netdev}:off\0" \
|
|
|
|
"addmisc=" \
|
|
|
|
"setenv bootargs ${bootargs} ${miscargs}\0" \
|
|
|
|
"adddfltmtd=" \
|
|
|
|
"if test \"x${mtdparts}\" == \"x\" ; then " \
|
|
|
|
"mtdparts default ; " \
|
|
|
|
"fi\0" \
|
|
|
|
"addmtd=" \
|
|
|
|
"run adddfltmtd ; " \
|
|
|
|
"setenv bootargs ${bootargs} ${mtdparts}\0" \
|
|
|
|
"addargs=run addcons addmtd addmisc\0" \
|
|
|
|
"mmcload=" \
|
|
|
|
"mmc rescan ; " \
|
2014-09-23 11:18:20 +00:00
|
|
|
"load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
|
2014-06-26 09:01:29 +00:00
|
|
|
"ubiload=" \
|
|
|
|
"ubi part UBI ; ubifsmount ubi0:rootfs ; " \
|
|
|
|
"ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
|
|
|
|
"netload=" \
|
|
|
|
"tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
|
|
|
|
"miscargs=nohlt panic=1\0" \
|
|
|
|
"mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
|
|
|
|
"ubiargs=" \
|
|
|
|
"setenv bootargs ubi.mtd=5 " \
|
|
|
|
"root=ubi0:rootfs rootfstype=ubifs\0" \
|
|
|
|
"nfsargs=" \
|
|
|
|
"setenv bootargs root=/dev/nfs rw " \
|
|
|
|
"nfsroot=${serverip}:${rootpath},v3,tcp\0" \
|
|
|
|
"mmc_mmc=" \
|
|
|
|
"run mmcload mmcargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"mmc_ubi=" \
|
|
|
|
"run mmcload ubiargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"mmc_nfs=" \
|
|
|
|
"run mmcload nfsargs addip addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"ubi_mmc=" \
|
|
|
|
"run ubiload mmcargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"ubi_ubi=" \
|
|
|
|
"run ubiload ubiargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"ubi_nfs=" \
|
|
|
|
"run ubiload nfsargs addip addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"net_mmc=" \
|
|
|
|
"run netload mmcargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"net_ubi=" \
|
|
|
|
"run netload ubiargs addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"net_nfs=" \
|
|
|
|
"run netload nfsargs addip addargs ; " \
|
|
|
|
"bootm ${kernel_addr_r}\0" \
|
|
|
|
"try_bootscript=" \
|
|
|
|
"mmc rescan;" \
|
2014-09-23 11:18:18 +00:00
|
|
|
"if test -e mmc 0:2 ${bootscript} ; then " \
|
2014-09-23 11:18:20 +00:00
|
|
|
"if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
|
2014-09-25 19:14:16 +00:00
|
|
|
"then ; " \
|
|
|
|
"echo Running bootscript... ; " \
|
|
|
|
"source ${kernel_addr_r} ; " \
|
2014-09-23 11:18:18 +00:00
|
|
|
"fi ; " \
|
2011-11-08 23:18:20 +00:00
|
|
|
"fi\0"
|
|
|
|
|
2013-06-16 13:39:02 +00:00
|
|
|
/* The rest of the configuration is shared */
|
|
|
|
#include <configs/mxs.h>
|
|
|
|
|
|
|
|
#endif /* __CONFIGS_M28EVK_H__ */
|