blob: a5e27404f86a7e28d6c4296a68965024487f3ae1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +05302/*
3 * Copyright 2016 Freescale Semiconductor, Inc.
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +05304 */
5
6#ifndef __LS1012ARDB_H__
7#define __LS1012ARDB_H__
8
9#include "ls1012a_common.h"
10
Shengzhou Liucb7fb122016-08-26 18:30:39 +080011/* DDR */
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053012#define CONFIG_DIMM_SLOTS_PER_CTLR 1
13#define CONFIG_CHIP_SELECTS_PER_CTRL 1
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053014#define CONFIG_SYS_SDRAM_SIZE 0x40000000
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053015#define CONFIG_CMD_MEMINFO
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053016#define CONFIG_SYS_MEMTEST_START 0x80000000
17#define CONFIG_SYS_MEMTEST_END 0x9fffffff
18
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053019
Kuldeep Singhdae56ea2019-09-18 14:58:11 +053020/* ENV */
21#define CONFIG_SYS_FSL_QSPI_BASE 0x40000000
22#define CONFIG_ENV_ADDR (CONFIG_SYS_FSL_QSPI_BASE + \
23 CONFIG_ENV_OFFSET)
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053024/*
25 * I2C IO expander
26 */
27
Yangbo Lu2786f902017-12-08 15:35:35 +080028#define I2C_MUX_IO_ADDR 0x24
Calvin Johnson6e6679b2018-03-08 15:30:30 +053029#define I2C_MUX_IO2_ADDR 0x25
Yangbo Lu2786f902017-12-08 15:35:35 +080030#define I2C_MUX_IO_0 0
31#define I2C_MUX_IO_1 1
32#define SW_BOOT_MASK 0x03
33#define SW_BOOT_EMU 0x02
34#define SW_BOOT_BANK1 0x00
35#define SW_BOOT_BANK2 0x01
36#define SW_REV_MASK 0xF8
37#define SW_REV_A 0xF8
38#define SW_REV_B 0xF0
Yangbo Lu13acb0d2017-12-08 15:35:36 +080039#define SW_REV_C 0xE8
40#define SW_REV_C1 0xE0
41#define SW_REV_C2 0xD8
42#define SW_REV_D 0xD0
43#define SW_REV_E 0xC8
Calvin Johnson6e6679b2018-03-08 15:30:30 +053044#define __PHY_MASK 0xF9
45#define __PHY_ETH2_MASK 0xFB
46#define __PHY_ETH1_MASK 0xFD
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053047
48/* MMC */
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053049#ifdef CONFIG_MMC
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053050#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053051#endif
52
Prabhakar Kushwahadf21f302016-12-26 12:15:08 +053053
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053054#define CONFIG_PCIE1 /* PCIE controller 1 */
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053055
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053056#define CONFIG_PCI_SCAN_SHOW
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053057
58#define CONFIG_CMD_MEMINFO
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +053059#define CONFIG_SYS_MEMTEST_START 0x80000000
60#define CONFIG_SYS_MEMTEST_END 0x9fffffff
61
Rajesh Bhagatd59447a2017-11-30 16:44:38 +053062#undef CONFIG_EXTRA_ENV_SETTINGS
63#define CONFIG_EXTRA_ENV_SETTINGS \
64 "verify=no\0" \
65 "fdt_high=0xffffffffffffffff\0" \
66 "initrd_high=0xffffffffffffffff\0" \
67 "fdt_addr=0x00f00000\0" \
68 "kernel_addr=0x01000000\0" \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +053069 "kernelheader_addr=0x800000\0" \
Rajesh Bhagatd59447a2017-11-30 16:44:38 +053070 "scriptaddr=0x80000000\0" \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +053071 "scripthdraddr=0x80080000\0" \
Rajesh Bhagatd59447a2017-11-30 16:44:38 +053072 "fdtheader_addr_r=0x80100000\0" \
73 "kernelheader_addr_r=0x80200000\0" \
74 "kernel_addr_r=0x81000000\0" \
75 "fdt_addr_r=0x90000000\0" \
76 "load_addr=0xa0000000\0" \
77 "kernel_size=0x2800000\0" \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +053078 "kernelheader_size=0x40000\0" \
Rajesh Bhagatd59447a2017-11-30 16:44:38 +053079 "console=ttyS0,115200\0" \
80 BOOTENV \
81 "boot_scripts=ls1012ardb_boot.scr\0" \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +053082 "boot_script_hdr=hdr_ls1012ardb_bs.out\0" \
Rajesh Bhagatd59447a2017-11-30 16:44:38 +053083 "scan_dev_for_boot_part=" \
84 "part list ${devtype} ${devnum} devplist; " \
85 "env exists devplist || setenv devplist 1; " \
86 "for distro_bootpart in ${devplist}; do " \
87 "if fstype ${devtype} " \
88 "${devnum}:${distro_bootpart} " \
89 "bootfstype; then " \
90 "run scan_dev_for_boot; " \
91 "fi; " \
92 "done\0" \
93 "scan_dev_for_boot=" \
94 "echo Scanning ${devtype} " \
95 "${devnum}:${distro_bootpart}...; " \
96 "for prefix in ${boot_prefixes}; do " \
97 "run scan_dev_for_scripts; " \
98 "done;" \
99 "\0" \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +0530100 "boot_a_script=" \
101 "load ${devtype} ${devnum}:${distro_bootpart} " \
102 "${scriptaddr} ${prefix}${script}; " \
103 "env exists secureboot && load ${devtype} " \
104 "${devnum}:${distro_bootpart} " \
Vinitha V Pillai25355ec2019-04-23 05:52:17 +0000105 "${scripthdraddr} ${prefix}${boot_script_hdr}; " \
106 "env exists secureboot " \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +0530107 "&& esbc_validate ${scripthdraddr};" \
108 "source ${scriptaddr}\0" \
Rajesh Bhagatd59447a2017-11-30 16:44:38 +0530109 "installer=load mmc 0:2 $load_addr " \
110 "/flex_installer_arm64.itb; " \
111 "bootm $load_addr#$board\0" \
112 "qspi_bootcmd=echo Trying load from qspi..;" \
113 "sf probe && sf read $load_addr " \
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +0530114 "$kernel_addr $kernel_size; env exists secureboot " \
115 "&& sf read $kernelheader_addr_r $kernelheader_addr " \
116 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
117 "bootm $load_addr#$board\0"
Rajesh Bhagatd59447a2017-11-30 16:44:38 +0530118
119#undef CONFIG_BOOTCOMMAND
Rajesh Bhagatfcafef62018-11-05 18:02:53 +0000120#ifdef CONFIG_TFABOOT
121#undef QSPI_NOR_BOOTCOMMAND
122#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
123 "env exists secureboot && esbc_halt;"
124#else
Calvin Johnson0e6101a2018-03-08 15:30:35 +0530125#define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
Vinitha Pillai-B572234b56f5b2018-01-09 23:03:42 +0530126 "env exists secureboot && esbc_halt;"
Rajesh Bhagatfcafef62018-11-05 18:02:53 +0000127#endif
Vinitha Pillai-B57223eea4a322017-03-23 13:48:20 +0530128
129#include <asm/fsl_secure_boot.h>
130
Prabhakar Kushwahaa315c662016-06-03 18:41:35 +0530131#endif /* __LS1012ARDB_H__ */