2014-10-03 18:21:06 +08:00
|
|
|
/*
|
2015-05-29 16:30:05 +08:00
|
|
|
* Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
|
2014-10-03 18:21:06 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
2016-02-06 11:30:11 +08:00
|
|
|
/* U-Boot - Common settings for UniPhier Family */
|
2014-10-03 18:21:06 +08:00
|
|
|
|
|
|
|
#ifndef __CONFIG_UNIPHIER_COMMON_H__
|
|
|
|
#define __CONFIG_UNIPHIER_COMMON_H__
|
|
|
|
|
2015-01-13 11:44:39 +08:00
|
|
|
#define CONFIG_I2C_EEPROM
|
|
|
|
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
|
|
|
|
|
2014-10-23 21:26:10 +08:00
|
|
|
#ifdef CONFIG_SYS_NS16550_SERIAL
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_SYS_NS16550_COM1 CONFIG_SUPPORT_CARD_UART_BASE
|
|
|
|
#define CONFIG_SYS_NS16550_CLK 12288000
|
|
|
|
#define CONFIG_SYS_NS16550_REG_SIZE -2
|
2014-10-23 21:26:10 +08:00
|
|
|
#endif
|
2014-10-03 18:21:06 +08:00
|
|
|
|
2014-12-05 23:03:22 +08:00
|
|
|
/* TODO: move to Kconfig and device tree */
|
|
|
|
#if 0
|
|
|
|
#define CONFIG_SYS_NS16550_SERIAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_SMC911X
|
|
|
|
|
2015-09-21 23:27:32 +08:00
|
|
|
/* dummy: referenced by examples/standalone/smc911x_eeprom.c */
|
|
|
|
#define CONFIG_SMC911X_BASE 0
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_SMC911X_32_BIT
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------
|
|
|
|
* MMU and Cache Setting
|
|
|
|
*----------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/* Comment out the following to enable L1 cache */
|
|
|
|
/* #define CONFIG_SYS_ICACHE_OFF */
|
|
|
|
/* #define CONFIG_SYS_DCACHE_OFF */
|
|
|
|
|
2015-02-27 01:27:01 +08:00
|
|
|
#define CONFIG_SYS_CACHELINE_SIZE 32
|
|
|
|
|
2014-10-03 18:21:06 +08:00
|
|
|
/* Comment out the following to enable L2 cache */
|
|
|
|
#define CONFIG_UNIPHIER_L2CACHE_ON
|
|
|
|
|
|
|
|
#define CONFIG_DISPLAY_CPUINFO
|
|
|
|
#define CONFIG_DISPLAY_BOARDINFO
|
2015-02-05 13:42:56 +08:00
|
|
|
#define CONFIG_MISC_INIT_F
|
2015-02-05 13:42:54 +08:00
|
|
|
#define CONFIG_BOARD_EARLY_INIT_F
|
2014-12-05 23:03:26 +08:00
|
|
|
#define CONFIG_BOARD_EARLY_INIT_R
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_BOARD_LATE_INIT
|
|
|
|
|
|
|
|
#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
|
|
|
|
|
|
|
|
#define CONFIG_TIMESTAMP
|
|
|
|
|
|
|
|
/* FLASH related */
|
|
|
|
#define CONFIG_MTD_DEVICE
|
|
|
|
|
|
|
|
/*
|
|
|
|
* uncomment the following to disable FLASH related code.
|
|
|
|
*/
|
|
|
|
/* #define CONFIG_SYS_NO_FLASH */
|
|
|
|
|
|
|
|
#define CONFIG_FLASH_CFI_DRIVER
|
|
|
|
#define CONFIG_SYS_FLASH_CFI
|
|
|
|
|
|
|
|
#define CONFIG_SYS_MAX_FLASH_SECT 256
|
|
|
|
#define CONFIG_SYS_MONITOR_BASE 0
|
|
|
|
#define CONFIG_SYS_FLASH_BASE 0
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flash_toggle does not work for out supoort card.
|
|
|
|
* We need to use flash_status_poll.
|
|
|
|
*/
|
|
|
|
#define CONFIG_SYS_CFI_FLASH_STATUS_POLL
|
|
|
|
|
|
|
|
#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
|
|
|
|
|
2015-09-11 19:17:45 +08:00
|
|
|
#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
|
2014-10-03 18:21:06 +08:00
|
|
|
|
|
|
|
/* serial console configuration */
|
|
|
|
#define CONFIG_BAUDRATE 115200
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(CONFIG_SPL_BUILD)
|
|
|
|
#define CONFIG_USE_ARCH_MEMSET
|
|
|
|
#define CONFIG_USE_ARCH_MEMCPY
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_SYS_LONGHELP /* undef to save memory */
|
|
|
|
|
|
|
|
#define CONFIG_CMDLINE_EDITING /* add command line history */
|
|
|
|
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
|
|
|
|
/* Print Buffer Size */
|
|
|
|
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
|
|
|
|
#define CONFIG_SYS_MAXARGS 16 /* max number of command */
|
|
|
|
/* Boot Argument Buffer Size */
|
|
|
|
#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
|
|
|
|
|
|
|
|
#define CONFIG_CONS_INDEX 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For NAND booting the environment is embedded in the U-Boot image. Please take
|
|
|
|
* look at the file board/amcc/canyonlands/u-boot-nand.lds for details.
|
|
|
|
*/
|
|
|
|
/* #define CONFIG_ENV_IS_IN_NAND */
|
|
|
|
#define CONFIG_ENV_IS_NOWHERE
|
|
|
|
#define CONFIG_ENV_SIZE 0x2000
|
|
|
|
#define CONFIG_ENV_OFFSET 0x0
|
|
|
|
/* #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
|
|
|
|
|
|
|
|
/* Time clock 1MHz */
|
|
|
|
#define CONFIG_SYS_TIMER_RATE 1000000
|
|
|
|
|
|
|
|
/*
|
|
|
|
* By default, ARP timeout is 5 sec.
|
|
|
|
* The first ARP request does not seem to work.
|
|
|
|
* So we need to retry ARP request anyway.
|
|
|
|
* We want to shrink the interval until the second ARP request.
|
|
|
|
*/
|
|
|
|
#define CONFIG_ARP_TIMEOUT 500UL /* 0.5 msec */
|
|
|
|
|
|
|
|
#define CONFIG_SYS_MAX_NAND_DEVICE 1
|
|
|
|
#define CONFIG_SYS_NAND_MAX_CHIPS 2
|
|
|
|
#define CONFIG_SYS_NAND_ONFI_DETECTION
|
|
|
|
|
|
|
|
#define CONFIG_NAND_DENALI_ECC_SIZE 1024
|
|
|
|
|
2015-09-21 23:27:34 +08:00
|
|
|
#ifdef CONFIG_ARCH_UNIPHIER_PH1_SLD3
|
2015-07-21 13:04:22 +08:00
|
|
|
#define CONFIG_SYS_NAND_REGS_BASE 0xf8100000
|
|
|
|
#define CONFIG_SYS_NAND_DATA_BASE 0xf8000000
|
|
|
|
#else
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_SYS_NAND_REGS_BASE 0x68100000
|
|
|
|
#define CONFIG_SYS_NAND_DATA_BASE 0x68000000
|
2015-07-21 13:04:22 +08:00
|
|
|
#endif
|
2014-10-03 18:21:06 +08:00
|
|
|
|
|
|
|
#define CONFIG_SYS_NAND_BASE (CONFIG_SYS_NAND_DATA_BASE + 0x10)
|
|
|
|
|
|
|
|
#define CONFIG_SYS_NAND_USE_FLASH_BBT
|
|
|
|
#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
|
|
|
|
|
2014-11-07 17:48:34 +08:00
|
|
|
/* USB */
|
|
|
|
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
|
2015-02-27 01:27:01 +08:00
|
|
|
#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 4
|
2014-11-07 17:48:34 +08:00
|
|
|
#define CONFIG_CMD_FAT
|
|
|
|
#define CONFIG_FAT_WRITE
|
|
|
|
#define CONFIG_DOS_PARTITION
|
|
|
|
|
2014-10-03 18:21:06 +08:00
|
|
|
/* memtest works on */
|
|
|
|
#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
|
|
|
|
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01000000)
|
|
|
|
|
|
|
|
#define CONFIG_BOOTDELAY 3
|
|
|
|
#define CONFIG_ZERO_BOOTDELAY_CHECK /* check for keypress on bootdelay==0 */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Network Configuration
|
|
|
|
*/
|
|
|
|
#define CONFIG_SERVERIP 192.168.11.1
|
|
|
|
#define CONFIG_IPADDR 192.168.11.10
|
|
|
|
#define CONFIG_GATEWAYIP 192.168.11.1
|
|
|
|
#define CONFIG_NETMASK 255.255.255.0
|
|
|
|
|
|
|
|
#define CONFIG_LOADADDR 0x84000000
|
|
|
|
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
|
|
|
|
|
|
|
|
#define CONFIG_CMDLINE_EDITING /* add command line history */
|
|
|
|
|
|
|
|
#define CONFIG_BOOTCOMMAND "run $bootmode"
|
|
|
|
|
|
|
|
#define CONFIG_ROOTPATH "/nfs/root/path"
|
|
|
|
#define CONFIG_NFSBOOTCOMMAND \
|
|
|
|
"setenv bootargs $bootargs root=/dev/nfs rw " \
|
|
|
|
"nfsroot=$serverip:$rootpath " \
|
|
|
|
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off;" \
|
2016-01-21 13:56:09 +08:00
|
|
|
"run __nfsboot"
|
2014-10-03 18:21:06 +08:00
|
|
|
|
2015-07-21 13:04:18 +08:00
|
|
|
#ifdef CONFIG_FIT
|
|
|
|
#define CONFIG_BOOTFILE "fitImage"
|
|
|
|
#define LINUXBOOT_ENV_SETTINGS \
|
|
|
|
"fit_addr=0x00100000\0" \
|
|
|
|
"fit_addr_r=0x84100000\0" \
|
|
|
|
"fit_size=0x00f00000\0" \
|
2015-09-21 23:27:38 +08:00
|
|
|
"norboot=setexpr fit_addr $nor_base + $fit_addr &&" \
|
2015-07-21 13:04:18 +08:00
|
|
|
"bootm $fit_addr\0" \
|
2015-09-21 23:27:38 +08:00
|
|
|
"nandboot=nand read $fit_addr_r $fit_addr $fit_size &&" \
|
2015-07-21 13:04:19 +08:00
|
|
|
"bootm $fit_addr_r\0" \
|
2015-09-21 23:27:38 +08:00
|
|
|
"tftpboot=tftpboot $fit_addr_r $bootfile &&" \
|
2016-01-21 13:56:09 +08:00
|
|
|
"bootm $fit_addr_r\0" \
|
|
|
|
"__nfsboot=run tftpboot\0"
|
2015-07-21 13:04:18 +08:00
|
|
|
#else
|
2015-12-18 13:52:32 +08:00
|
|
|
#define CONFIG_CMD_BOOTZ
|
|
|
|
#define CONFIG_BOOTFILE "zImage"
|
2015-07-21 13:04:18 +08:00
|
|
|
#define LINUXBOOT_ENV_SETTINGS \
|
|
|
|
"fdt_addr=0x00100000\0" \
|
|
|
|
"fdt_addr_r=0x84100000\0" \
|
|
|
|
"fdt_size=0x00008000\0" \
|
|
|
|
"kernel_addr=0x00200000\0" \
|
2015-12-18 13:52:32 +08:00
|
|
|
"kernel_addr_r=0x80208000\0" \
|
2015-07-21 13:04:18 +08:00
|
|
|
"kernel_size=0x00800000\0" \
|
|
|
|
"ramdisk_addr=0x00a00000\0" \
|
|
|
|
"ramdisk_addr_r=0x84a00000\0" \
|
|
|
|
"ramdisk_size=0x00600000\0" \
|
2015-07-21 13:04:19 +08:00
|
|
|
"ramdisk_file=rootfs.cpio.uboot\0" \
|
2016-01-21 13:56:08 +08:00
|
|
|
"boot_common=setexpr bootm_low $kernel_addr_r '&' fe000000 &&" \
|
|
|
|
"bootz $kernel_addr_r $ramdisk_addr_r $fdt_addr_r\0" \
|
|
|
|
"norboot=setexpr kernel_addr $nor_base + $kernel_addr &&" \
|
2016-01-21 13:56:06 +08:00
|
|
|
"cp.b $kernel_addr $kernel_addr_r $kernel_size &&" \
|
2016-01-21 13:56:08 +08:00
|
|
|
"setexpr ramdisk_addr_r $nor_base + $ramdisk_addr &&" \
|
|
|
|
"setexpr fdt_addr_r $nor_base + $fdt_addr &&" \
|
|
|
|
"run boot_common\0" \
|
|
|
|
"nandboot=nand read $kernel_addr_r $kernel_addr $kernel_size &&" \
|
2015-07-21 13:04:18 +08:00
|
|
|
"nand read $ramdisk_addr_r $ramdisk_addr $ramdisk_size &&" \
|
|
|
|
"nand read $fdt_addr_r $fdt_addr $fdt_size &&" \
|
2016-01-21 13:56:08 +08:00
|
|
|
"run boot_common\0" \
|
|
|
|
"tftpboot=tftpboot $kernel_addr_r $bootfile &&" \
|
2015-07-21 13:04:19 +08:00
|
|
|
"tftpboot $ramdisk_addr_r $ramdisk_file &&" \
|
|
|
|
"tftpboot $fdt_addr_r $fdt_file &&" \
|
2016-01-21 13:56:09 +08:00
|
|
|
"run boot_common\0" \
|
|
|
|
"__nfsboot=tftpboot $kernel_addr_r $bootfile &&" \
|
|
|
|
"tftpboot $fdt_addr_r $fdt_file &&" \
|
|
|
|
"tftpboot $fdt_addr_r $fdt_file &&" \
|
|
|
|
"setenv ramdisk_addr_r - &&" \
|
2016-01-21 13:56:08 +08:00
|
|
|
"run boot_common\0"
|
2015-07-21 13:04:18 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
|
|
|
"netdev=eth0\0" \
|
|
|
|
"verify=n\0" \
|
2016-01-21 13:56:06 +08:00
|
|
|
"nor_base=0x42000000\0" \
|
2016-01-21 13:56:07 +08:00
|
|
|
"bootm_low=0x80000000\0" \
|
2015-07-21 13:04:18 +08:00
|
|
|
"nandupdate=nand erase 0 0x00100000 &&" \
|
2015-08-28 19:13:18 +08:00
|
|
|
"tftpboot u-boot-spl-dtb.bin &&" \
|
2015-07-21 13:04:18 +08:00
|
|
|
"nand write $loadaddr 0 0x00010000 &&" \
|
|
|
|
"tftpboot u-boot-dtb.img &&" \
|
|
|
|
"nand write $loadaddr 0x00010000 0x000f0000\0" \
|
|
|
|
LINUXBOOT_ENV_SETTINGS
|
2014-10-03 18:21:06 +08:00
|
|
|
|
2016-01-09 01:12:26 +08:00
|
|
|
#define CONFIG_SYS_BOOTMAPSZ 0x20000000
|
|
|
|
|
2014-10-03 18:21:06 +08:00
|
|
|
/* Open Firmware flat tree */
|
|
|
|
#define CONFIG_OF_LIBFDT
|
|
|
|
|
2015-09-11 19:17:49 +08:00
|
|
|
#define CONFIG_SYS_SDRAM_BASE 0x80000000
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_NR_DRAM_BANKS 2
|
|
|
|
|
2015-09-21 23:27:34 +08:00
|
|
|
#if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3) || \
|
|
|
|
defined(CONFIG_ARCH_UNIPHIER_PH1_LD4) || \
|
|
|
|
defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
|
2014-12-05 23:03:22 +08:00
|
|
|
#define CONFIG_SPL_TEXT_BASE 0x00040000
|
2015-09-21 23:27:39 +08:00
|
|
|
#else
|
2014-12-05 23:03:22 +08:00
|
|
|
#define CONFIG_SPL_TEXT_BASE 0x00100000
|
|
|
|
#endif
|
|
|
|
|
2015-03-22 23:07:26 +08:00
|
|
|
#define CONFIG_SPL_STACK (0x0ff08000)
|
2015-03-22 23:07:28 +08:00
|
|
|
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE)
|
2014-10-03 18:21:06 +08:00
|
|
|
|
2015-03-22 23:07:24 +08:00
|
|
|
#define CONFIG_PANIC_HANG
|
|
|
|
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_SPL_FRAMEWORK
|
2015-03-22 23:07:25 +08:00
|
|
|
#define CONFIG_SPL_SERIAL_SUPPORT
|
2014-10-03 18:21:06 +08:00
|
|
|
#define CONFIG_SPL_NAND_SUPPORT
|
|
|
|
|
|
|
|
#define CONFIG_SPL_LIBCOMMON_SUPPORT /* for mem_malloc_init */
|
|
|
|
#define CONFIG_SPL_LIBGENERIC_SUPPORT
|
|
|
|
|
|
|
|
#define CONFIG_SPL_BOARD_INIT
|
|
|
|
|
|
|
|
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x10000
|
|
|
|
|
2015-03-22 23:07:27 +08:00
|
|
|
#define CONFIG_SPL_MAX_FOOTPRINT 0x10000
|
|
|
|
|
2014-10-03 18:21:06 +08:00
|
|
|
#endif /* __CONFIG_UNIPHIER_COMMON_H__ */
|