2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-10-03 10:21:06 +00:00
|
|
|
/*
|
2016-08-10 07:08:49 +00:00
|
|
|
* Copyright (C) 2012-2015 Panasonic Corporation
|
|
|
|
* Copyright (C) 2015-2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
2014-10-03 10:21:06 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-06 03:30:11 +00:00
|
|
|
/* U-Boot - Common settings for UniPhier Family */
|
2014-10-03 10:21:06 +00:00
|
|
|
|
2020-07-30 09:28:04 +00:00
|
|
|
#ifndef __CONFIG_UNIPHIER_H__
|
|
|
|
#define __CONFIG_UNIPHIER_H__
|
2014-10-03 10:21:06 +00:00
|
|
|
|
2018-07-20 12:47:18 +00:00
|
|
|
#include <config_distro_bootcmd.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_CMD_MMC
|
|
|
|
#define BOOT_TARGET_DEVICE_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
|
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICE_MMC(func)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CMD_UBIFS
|
2022-05-31 08:32:36 +00:00
|
|
|
#define BOOT_TARGET_DEVICE_UBIFS(func) func(UBIFS, ubifs, 0, UBI, boot)
|
2018-07-20 12:47:18 +00:00
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICE_UBIFS(func)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CMD_USB
|
|
|
|
#define BOOT_TARGET_DEVICE_USB(func) func(USB, usb, 0)
|
|
|
|
#else
|
|
|
|
#define BOOT_TARGET_DEVICE_USB(func)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BOOT_TARGET_DEVICES(func) \
|
|
|
|
BOOT_TARGET_DEVICE_MMC(func) \
|
|
|
|
BOOT_TARGET_DEVICE_UBIFS(func) \
|
|
|
|
BOOT_TARGET_DEVICE_USB(func)
|
|
|
|
|
2017-07-13 11:32:15 +00:00
|
|
|
#if !defined(CONFIG_ARM64)
|
2014-10-03 10:21:06 +00:00
|
|
|
/* Time clock 1MHz */
|
|
|
|
#define CONFIG_SYS_TIMER_RATE 1000000
|
2016-04-21 05:43:18 +00:00
|
|
|
#endif
|
|
|
|
|
2022-11-12 22:36:51 +00:00
|
|
|
#define CFG_SYS_NAND_REGS_BASE 0x68100000
|
|
|
|
#define CFG_SYS_NAND_DATA_BASE 0x68000000
|
2014-10-03 10:21:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2017-07-13 11:32:15 +00:00
|
|
|
#if defined(CONFIG_ARM64)
|
2017-01-27 21:53:54 +00:00
|
|
|
/* ARM Trusted Firmware */
|
|
|
|
#define BOOT_IMAGES \
|
2017-02-12 09:21:16 +00:00
|
|
|
"second_image=unph_bl.bin\0" \
|
2017-01-27 21:53:54 +00:00
|
|
|
"third_image=fip.bin\0"
|
|
|
|
#else
|
|
|
|
#define BOOT_IMAGES \
|
|
|
|
"second_image=u-boot-spl.bin\0" \
|
|
|
|
"third_image=u-boot.bin\0"
|
|
|
|
#endif
|
|
|
|
|
2014-10-03 10:21:06 +00:00
|
|
|
#define CONFIG_ROOTPATH "/nfs/root/path"
|
|
|
|
|
2015-07-21 05:04:18 +00:00
|
|
|
#ifdef CONFIG_FIT
|
2019-07-10 11:07:50 +00:00
|
|
|
#define KERNEL_ADDR_R_OFFSET "0x05100000"
|
2015-07-21 05:04:18 +00:00
|
|
|
#define LINUXBOOT_ENV_SETTINGS \
|
2018-07-20 12:47:18 +00:00
|
|
|
"tftpboot=tftpboot $kernel_addr_r $bootfile &&" \
|
|
|
|
"bootm $kernel_addr_r\0" \
|
2016-01-21 05:56:09 +00:00
|
|
|
"__nfsboot=run tftpboot\0"
|
2015-07-21 05:04:18 +00:00
|
|
|
#else
|
2016-04-21 05:43:18 +00:00
|
|
|
#ifdef CONFIG_ARM64
|
|
|
|
#define LINUXBOOT_CMD "booti"
|
2019-07-10 11:07:50 +00:00
|
|
|
#define KERNEL_ADDR_R_OFFSET "0x02080000"
|
2016-04-21 05:43:18 +00:00
|
|
|
#else
|
|
|
|
#define LINUXBOOT_CMD "bootz"
|
2019-07-10 11:07:50 +00:00
|
|
|
#define KERNEL_ADDR_R_OFFSET "0x00208000"
|
2016-04-21 05:43:18 +00:00
|
|
|
#endif
|
2015-07-21 05:04:18 +00:00
|
|
|
#define LINUXBOOT_ENV_SETTINGS \
|
2017-01-27 21:53:50 +00:00
|
|
|
"boot_common=setexpr bootm_low $kernel_addr_r '&' fe000000 && " \
|
2016-04-21 05:43:18 +00:00
|
|
|
LINUXBOOT_CMD " $kernel_addr_r $ramdisk_addr_r $fdt_addr_r\0" \
|
2018-07-20 12:47:18 +00:00
|
|
|
"tftpboot=tftpboot $kernel_addr_r $bootfile && " \
|
2018-05-17 10:55:20 +00:00
|
|
|
"tftpboot $fdt_addr_r $fdtfile &&" \
|
2018-07-20 12:47:18 +00:00
|
|
|
"tftpboot $ramdisk_addr_r $ramdisk_file &&" \
|
|
|
|
"setenv ramdisk_addr_r $ramdisk_addr_r:$filesize &&" \
|
2016-01-21 05:56:09 +00:00
|
|
|
"run boot_common\0" \
|
2017-01-27 21:53:50 +00:00
|
|
|
"__nfsboot=tftpboot $kernel_addr_load $bootfile && " \
|
2018-05-17 10:55:20 +00:00
|
|
|
"tftpboot $fdt_addr_r $fdtfile &&" \
|
2016-01-21 05:56:09 +00:00
|
|
|
"setenv ramdisk_addr_r - &&" \
|
2016-01-21 05:56:08 +00:00
|
|
|
"run boot_common\0"
|
2015-07-21 05:04:18 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
2019-07-10 11:07:50 +00:00
|
|
|
"fdt_addr_r_offset=0x05100000\0" \
|
|
|
|
"kernel_addr_r_offset=" KERNEL_ADDR_R_OFFSET "\0" \
|
|
|
|
"ramdisk_addr_r_offset=0x06000000\0" \
|
|
|
|
"ramdisk_file=rootfs.cpio.gz\0" \
|
2015-07-21 05:04:18 +00:00
|
|
|
"netdev=eth0\0" \
|
2017-01-27 21:53:51 +00:00
|
|
|
"initrd_high=0xffffffffffffffff\0" \
|
2019-07-10 11:07:48 +00:00
|
|
|
"loadaddr_offset=0x05000000\0" \
|
2018-12-19 11:03:14 +00:00
|
|
|
"script=boot.scr\0" \
|
2018-07-20 12:47:18 +00:00
|
|
|
"scriptaddr=0x85000000\0" \
|
2016-01-21 05:56:06 +00:00
|
|
|
"nor_base=0x42000000\0" \
|
2018-12-19 11:03:13 +00:00
|
|
|
"emmcboot=mmcsetn && run bootcmd_mmc${mmc_first_dev}\0" \
|
|
|
|
"nandboot=run bootcmd_ubifs0\0" \
|
|
|
|
"norboot=run tftpboot\0" \
|
2020-02-13 03:27:37 +00:00
|
|
|
"sdboot=sdsetn && run bootcmd_mmc${sd_first_dev}\0" \
|
2018-12-19 11:03:13 +00:00
|
|
|
"usbboot=run bootcmd_usb0\0" \
|
2018-12-19 11:03:14 +00:00
|
|
|
"emmcscript=setenv devtype mmc && " \
|
|
|
|
"mmcsetn && " \
|
|
|
|
"setenv devnum ${mmc_first_dev} && " \
|
|
|
|
"run loadscript_fat\0" \
|
|
|
|
"nandscript=echo Running ${script} from ubi ... && " \
|
|
|
|
"ubi part UBI && " \
|
|
|
|
"ubifsmount ubi0:boot && " \
|
|
|
|
"ubifsload ${loadaddr} ${script} && " \
|
2020-01-30 13:20:38 +00:00
|
|
|
"source $loadaddr\0" \
|
2020-02-13 03:27:37 +00:00
|
|
|
"sdscript=setenv devtype mmc && " \
|
|
|
|
"sdsetn && " \
|
|
|
|
"setenv devnum ${sd_first_dev} && " \
|
|
|
|
"run loadscript_fat\0" \
|
2018-12-19 11:03:14 +00:00
|
|
|
"norscript=echo Running ${script} from tftp ... && " \
|
|
|
|
"tftpboot ${script} &&" \
|
2020-01-30 13:20:38 +00:00
|
|
|
"source $loadaddr\0" \
|
2018-12-19 11:03:14 +00:00
|
|
|
"usbscript=usb start && " \
|
|
|
|
"setenv devtype usb && " \
|
|
|
|
"setenv devnum 0 && " \
|
|
|
|
"run loadscript_fat\0" \
|
|
|
|
"loadscript_fat=echo Running ${script} from ${devtype}${devnum} ... && " \
|
|
|
|
"load ${devtype} ${devnum}:1 ${loadaddr} ${script} && " \
|
2020-01-30 13:20:38 +00:00
|
|
|
"source $loadaddr\0" \
|
2016-03-24 13:23:36 +00:00
|
|
|
"sramupdate=setexpr tmp_addr $nor_base + 0x50000 &&" \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $tmp_addr $second_image && " \
|
2017-01-27 21:53:53 +00:00
|
|
|
"setexpr tmp_addr $nor_base + 0x70000 && " \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $tmp_addr $third_image\0" \
|
2016-02-16 08:08:41 +00:00
|
|
|
"emmcupdate=mmcsetn &&" \
|
2018-04-20 09:38:27 +00:00
|
|
|
"mmc dev $mmc_first_dev &&" \
|
2016-02-16 08:08:41 +00:00
|
|
|
"mmc partconf $mmc_first_dev 0 1 1 &&" \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $second_image && " \
|
2017-01-27 21:53:53 +00:00
|
|
|
"mmc write $loadaddr 0 100 && " \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $third_image && " \
|
2018-02-02 05:16:36 +00:00
|
|
|
"mmc write $loadaddr 100 f00\0" \
|
2015-07-21 05:04:18 +00:00
|
|
|
"nandupdate=nand erase 0 0x00100000 &&" \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $second_image && " \
|
2017-01-27 21:53:53 +00:00
|
|
|
"nand write $loadaddr 0 0x00020000 && " \
|
2017-01-27 21:53:54 +00:00
|
|
|
"tftpboot $third_image && " \
|
2018-02-02 05:16:36 +00:00
|
|
|
"nand write $loadaddr 0x00020000 0x001e0000\0" \
|
2020-02-13 03:27:37 +00:00
|
|
|
"sdupdate=sdsetn &&" \
|
|
|
|
"mmc dev $sd_first_dev &&" \
|
|
|
|
"tftpboot $second_image && " \
|
|
|
|
"mmc write $loadaddr 0 100 && " \
|
|
|
|
"tftpboot $third_image && " \
|
|
|
|
"mmc write $loadaddr 100 f00\0" \
|
2017-05-10 11:57:39 +00:00
|
|
|
"usbupdate=usb start &&" \
|
|
|
|
"tftpboot $second_image && " \
|
|
|
|
"usb write $loadaddr 0 100 && " \
|
|
|
|
"tftpboot $third_image && " \
|
2018-02-02 05:16:36 +00:00
|
|
|
"usb write $loadaddr 100 f00\0" \
|
2017-01-27 21:53:54 +00:00
|
|
|
BOOT_IMAGES \
|
2018-07-20 12:47:18 +00:00
|
|
|
LINUXBOOT_ENV_SETTINGS \
|
|
|
|
BOOTENV
|
2014-10-03 10:21:06 +00:00
|
|
|
|
2016-01-08 17:12:26 +00:00
|
|
|
#define CONFIG_SYS_BOOTMAPSZ 0x20000000
|
|
|
|
|
2017-01-27 21:53:49 +00:00
|
|
|
/* only for SPL */
|
2015-03-22 15:07:24 +00:00
|
|
|
|
2022-09-07 02:26:52 +00:00
|
|
|
/* subtract sizeof(struct legacy_img_hdr) */
|
2018-09-10 03:58:33 +00:00
|
|
|
#define CONFIG_SYS_UBOOT_BASE (0x130000 - 0x40)
|
2014-10-03 10:21:06 +00:00
|
|
|
|
2020-07-30 09:28:04 +00:00
|
|
|
#endif /* __CONFIG_UNIPHIER_H__ */
|