2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2013-11-06 14:59:08 +00:00
|
|
|
/* Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
|
2008-07-23 22:11:47 +00:00
|
|
|
* Hayden Fraser (Hayden.Fraser@freescale.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _M5253DEMO_H
|
|
|
|
#define _M5253DEMO_H
|
|
|
|
|
2020-05-10 17:40:09 +00:00
|
|
|
#include <linux/stringify.h>
|
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_UART_PORT (0)
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Configuration for environment
|
|
|
|
* Environment is embedded in u-boot in the second sector of the flash
|
|
|
|
*/
|
|
|
|
|
2015-03-29 20:54:16 +00:00
|
|
|
#define LDS_BOARD_TEXT \
|
2017-08-03 18:21:49 +00:00
|
|
|
. = DEFINED(env_offset) ? env_offset : .; \
|
|
|
|
env/embedded.o(.text*);
|
2015-03-29 20:54:16 +00:00
|
|
|
|
2017-05-17 09:25:30 +00:00
|
|
|
#ifdef CONFIG_IDE
|
2008-07-23 22:11:47 +00:00
|
|
|
/* ATA */
|
|
|
|
# define CONFIG_IDE_PREINIT 1
|
|
|
|
# undef CONFIG_LBA48
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_DRIVER_DM9000
|
|
|
|
#ifdef CONFIG_DRIVER_DM9000
|
2008-10-21 10:03:07 +00:00
|
|
|
# define CONFIG_DM9000_BASE (CONFIG_SYS_CS1_BASE | 0x300)
|
2008-07-23 22:11:47 +00:00
|
|
|
# define DM9000_IO CONFIG_DM9000_BASE
|
|
|
|
# define DM9000_DATA (CONFIG_DM9000_BASE + 4)
|
|
|
|
# undef CONFIG_DM9000_DEBUG
|
2011-08-19 02:18:15 +00:00
|
|
|
# define CONFIG_DM9000_BYTE_SWAPPED
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
# define CONFIG_OVERWRITE_ETHADDR_ONCE
|
|
|
|
|
|
|
|
# define CONFIG_EXTRA_ENV_SETTINGS \
|
|
|
|
"netdev=eth0\0" \
|
2012-09-23 15:41:24 +00:00
|
|
|
"inpclk=" __stringify(CONFIG_SYS_INPUT_CLKSRC) "\0" \
|
2008-07-23 22:11:47 +00:00
|
|
|
"loadaddr=10000\0" \
|
|
|
|
"u-boot=u-boot.bin\0" \
|
|
|
|
"load=tftp ${loadaddr) ${u-boot}\0" \
|
|
|
|
"upd=run load; run prog\0" \
|
2010-03-10 17:56:36 +00:00
|
|
|
"prog=prot off 0xff800000 0xff82ffff;" \
|
|
|
|
"era 0xff800000 0xff82ffff;" \
|
2010-03-16 00:39:21 +00:00
|
|
|
"cp.b ${loadaddr} 0xff800000 ${filesize};" \
|
2008-07-23 22:11:47 +00:00
|
|
|
"save\0" \
|
|
|
|
""
|
|
|
|
#endif
|
|
|
|
|
2018-03-28 12:38:20 +00:00
|
|
|
#define CONFIG_HOSTNAME "M5253DEMO"
|
2008-07-23 22:11:47 +00:00
|
|
|
|
2008-08-18 21:01:19 +00:00
|
|
|
/* I2C */
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_I2C_PINMUX_REG (*(u32 *) (CONFIG_SYS_MBAR+0x19C))
|
|
|
|
#define CONFIG_SYS_I2C_PINMUX_CLR (0xFFFFE7FF)
|
|
|
|
#define CONFIG_SYS_I2C_PINMUX_SET (0)
|
2008-08-18 21:01:19 +00:00
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#undef CONFIG_SYS_PLL_BYPASS /* bypass PLL for test purpose */
|
|
|
|
#define CONFIG_SYS_FAST_CLK
|
|
|
|
#ifdef CONFIG_SYS_FAST_CLK
|
|
|
|
# define CONFIG_SYS_PLLCR 0x1243E054
|
|
|
|
# define CONFIG_SYS_CLK 140000000
|
2008-07-23 22:11:47 +00:00
|
|
|
#else
|
2008-10-16 13:01:15 +00:00
|
|
|
# define CONFIG_SYS_PLLCR 0x135a4140
|
|
|
|
# define CONFIG_SYS_CLK 70000000
|
2008-07-23 22:11:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Low Level Configuration Settings
|
|
|
|
* (address mappings, register initial values, etc.)
|
|
|
|
* You should know what you are doing if you make changes here.
|
|
|
|
*/
|
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_MBAR 0x10000000 /* Register Base Addrs */
|
|
|
|
#define CONFIG_SYS_MBAR2 0x80000000 /* Module Base Addrs 2 */
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Definitions for initial stack pointer and data area (in DPRAM)
|
|
|
|
*/
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_INIT_RAM_ADDR 0x20000000
|
2010-10-26 11:32:32 +00:00
|
|
|
#define CONFIG_SYS_INIT_RAM_SIZE 0x10000 /* Size of used area in internal SRAM */
|
2010-10-26 12:34:52 +00:00
|
|
|
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Start addresses for the final memory configuration
|
|
|
|
* (Set up by the startup code)
|
2008-10-16 13:01:15 +00:00
|
|
|
* Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
|
2008-07-23 22:11:47 +00:00
|
|
|
*/
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_SDRAM_BASE 0x00000000
|
|
|
|
#define CONFIG_SYS_SDRAM_SIZE 16 /* SDRAM size in MB */
|
2008-07-23 22:11:47 +00:00
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_MONITOR_LEN 0x40000
|
|
|
|
#define CONFIG_SYS_BOOTPARAMS_LEN (64*1024)
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For booting Linux, the board info and command line data
|
|
|
|
* have to be in the first 8 MB of memory, since this is
|
|
|
|
* the maximum mapped by the Linux kernel during initialization ??
|
|
|
|
*/
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20))
|
2009-01-27 12:57:47 +00:00
|
|
|
#define CONFIG_SYS_BOOTM_LEN (CONFIG_SYS_SDRAM_SIZE << 20)
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
/* FLASH organization */
|
2008-10-21 10:03:07 +00:00
|
|
|
#define CONFIG_SYS_FLASH_BASE (CONFIG_SYS_CS0_BASE)
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_MAX_FLASH_SECT 2048 /* max number of sectors on one chip */
|
|
|
|
#define CONFIG_SYS_FLASH_ERASE_TOUT 1000
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
#define FLASH_SST6401B 0x200
|
|
|
|
#define SST_ID_xF6401B 0x236D236D
|
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#ifdef CONFIG_SYS_FLASH_CFI
|
2008-07-23 22:11:47 +00:00
|
|
|
/*
|
|
|
|
* Unable to use CFI driver, due to incompatible sector erase command by SST.
|
|
|
|
* Amd/Atmel use 0x30 for sector erase, SST use 0x50.
|
|
|
|
* 0x30 is block erase in SST
|
|
|
|
*/
|
2008-10-16 13:01:15 +00:00
|
|
|
# define CONFIG_SYS_FLASH_SIZE 0x800000
|
|
|
|
# define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
|
2008-07-23 22:11:47 +00:00
|
|
|
# define CONFIG_FLASH_CFI_LEGACY
|
|
|
|
#else
|
2008-10-16 13:01:15 +00:00
|
|
|
# define CONFIG_SYS_SST_SECT 2048
|
|
|
|
# define CONFIG_SYS_SST_SECTSZ 0x1000
|
|
|
|
# define CONFIG_SYS_FLASH_WRITE_TOUT 500
|
2008-07-23 22:11:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Cache Configuration */
|
|
|
|
|
2010-03-12 04:12:53 +00:00
|
|
|
#define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
|
2010-10-26 11:32:32 +00:00
|
|
|
CONFIG_SYS_INIT_RAM_SIZE - 8)
|
2010-03-12 04:12:53 +00:00
|
|
|
#define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
|
2010-10-26 11:32:32 +00:00
|
|
|
CONFIG_SYS_INIT_RAM_SIZE - 4)
|
2010-03-12 04:12:53 +00:00
|
|
|
#define CONFIG_SYS_ICACHE_INV (CF_CACR_DCM)
|
|
|
|
#define CONFIG_SYS_CACHE_ACR0 (CONFIG_SYS_FLASH_BASE | \
|
|
|
|
CF_ADDRMASK(8) | \
|
|
|
|
CF_ACR_EN | CF_ACR_SM_ALL)
|
|
|
|
#define CONFIG_SYS_CACHE_ACR1 (CONFIG_SYS_SDRAM_BASE | \
|
|
|
|
CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
|
|
|
|
CF_ACR_EN | CF_ACR_SM_ALL)
|
|
|
|
#define CONFIG_SYS_CACHE_ICACR (CF_CACR_CENB | CF_CACR_CEIB | \
|
|
|
|
CF_CACR_DBWE)
|
|
|
|
|
2008-07-23 22:11:47 +00:00
|
|
|
/* Port configuration */
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_FECI2C 0xF0
|
2008-07-23 22:11:47 +00:00
|
|
|
|
2008-10-21 10:03:07 +00:00
|
|
|
#define CONFIG_SYS_CS0_BASE 0xFF800000
|
|
|
|
#define CONFIG_SYS_CS0_MASK 0x007F0021
|
|
|
|
#define CONFIG_SYS_CS0_CTRL 0x00001D80
|
2008-07-23 22:11:47 +00:00
|
|
|
|
2008-10-21 10:03:07 +00:00
|
|
|
#define CONFIG_SYS_CS1_BASE 0xE0000000
|
|
|
|
#define CONFIG_SYS_CS1_MASK 0x00000001
|
|
|
|
#define CONFIG_SYS_CS1_CTRL 0x00003DD8
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------
|
|
|
|
* Port configuration
|
|
|
|
*/
|
2008-10-16 13:01:15 +00:00
|
|
|
#define CONFIG_SYS_GPIO_FUNC 0x00000008 /* Set gpio pins: none */
|
|
|
|
#define CONFIG_SYS_GPIO1_FUNC 0x00df00f0 /* 36-39(SWITCH),48-52(FPGAs),54 */
|
|
|
|
#define CONFIG_SYS_GPIO_EN 0x00000008 /* Set gpio output enable */
|
|
|
|
#define CONFIG_SYS_GPIO1_EN 0x00c70000 /* Set gpio output enable */
|
|
|
|
#define CONFIG_SYS_GPIO_OUT 0x00000008 /* Set outputs to default state */
|
|
|
|
#define CONFIG_SYS_GPIO1_OUT 0x00c70000 /* Set outputs to default state */
|
|
|
|
#define CONFIG_SYS_GPIO1_LED 0x00400000 /* user led */
|
2008-07-23 22:11:47 +00:00
|
|
|
|
|
|
|
#endif /* _M5253DEMO_H */
|