2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2008-01-16 07:13:58 +00:00
|
|
|
/*
|
2011-01-13 16:09:27 +00:00
|
|
|
* Copyright 2008-2011 Freescale Semiconductor, Inc.
|
2008-01-16 07:13:58 +00:00
|
|
|
*
|
|
|
|
* (C) Copyright 2000
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2022-07-31 18:28:48 +00:00
|
|
|
#include <display_options.h>
|
2020-05-10 17:40:13 +00:00
|
|
|
#include <asm/bitops.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2011-02-03 15:02:13 +00:00
|
|
|
#include <linux/compiler.h>
|
2008-01-16 07:13:58 +00:00
|
|
|
#include <asm/fsl_law.h>
|
|
|
|
#include <asm/io.h>
|
2015-11-05 14:43:40 +00:00
|
|
|
#include <linux/log2.h>
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2008-06-11 05:44:10 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2011-01-19 09:05:26 +00:00
|
|
|
#define FSL_HW_NUM_LAWS CONFIG_SYS_FSL_NUM_LAWS
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
#ifdef CONFIG_FSL_CORENET
|
2010-06-17 16:37:23 +00:00
|
|
|
#define LAW_BASE (CONFIG_SYS_FSL_CORENET_CCM_ADDR)
|
|
|
|
#define LAWAR_ADDR(x) (&((ccsr_local_t *)LAW_BASE)->law[x].lawar)
|
|
|
|
#define LAWBARH_ADDR(x) (&((ccsr_local_t *)LAW_BASE)->law[x].lawbarh)
|
|
|
|
#define LAWBARL_ADDR(x) (&((ccsr_local_t *)LAW_BASE)->law[x].lawbarl)
|
|
|
|
#define LAWBAR_SHIFT 0
|
|
|
|
#else
|
|
|
|
#define LAW_BASE (CONFIG_SYS_IMMR + 0xc08)
|
|
|
|
#define LAWAR_ADDR(x) ((u32 *)LAW_BASE + 8 * x + 2)
|
|
|
|
#define LAWBAR_ADDR(x) ((u32 *)LAW_BASE + 8 * x)
|
|
|
|
#define LAWBAR_SHIFT 12
|
|
|
|
#endif
|
2009-03-19 07:32:23 +00:00
|
|
|
|
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
static inline phys_addr_t get_law_base_addr(int idx)
|
2009-03-19 07:32:23 +00:00
|
|
|
{
|
2010-06-17 16:37:23 +00:00
|
|
|
#ifdef CONFIG_FSL_CORENET
|
|
|
|
return (phys_addr_t)
|
|
|
|
((u64)in_be32(LAWBARH_ADDR(idx)) << 32) |
|
|
|
|
in_be32(LAWBARL_ADDR(idx));
|
|
|
|
#else
|
|
|
|
return (phys_addr_t)in_be32(LAWBAR_ADDR(idx)) << LAWBAR_SHIFT;
|
|
|
|
#endif
|
2009-03-19 07:32:23 +00:00
|
|
|
}
|
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
static inline void set_law_base_addr(int idx, phys_addr_t addr)
|
2009-03-19 07:32:23 +00:00
|
|
|
{
|
2010-06-17 16:37:23 +00:00
|
|
|
#ifdef CONFIG_FSL_CORENET
|
|
|
|
out_be32(LAWBARL_ADDR(idx), addr & 0xffffffff);
|
|
|
|
out_be32(LAWBARH_ADDR(idx), (u64)addr >> 32);
|
2009-03-19 07:32:23 +00:00
|
|
|
#else
|
2010-06-17 16:37:23 +00:00
|
|
|
out_be32(LAWBAR_ADDR(idx), addr >> LAWBAR_SHIFT);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2008-01-16 07:13:58 +00:00
|
|
|
void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
|
|
|
|
{
|
2012-12-13 20:48:51 +00:00
|
|
|
gd->arch.used_laws |= (1 << idx);
|
2008-06-11 05:44:10 +00:00
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
out_be32(LAWAR_ADDR(idx), 0);
|
|
|
|
set_law_base_addr(idx, addr);
|
|
|
|
out_be32(LAWAR_ADDR(idx), LAW_EN | ((u32)id << 20) | (u32)sz);
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2009-09-04 22:05:24 +00:00
|
|
|
/* Read back so that we sync the writes */
|
2010-06-17 16:37:23 +00:00
|
|
|
in_be32(LAWAR_ADDR(idx));
|
2008-01-16 07:13:58 +00:00
|
|
|
}
|
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
void disable_law(u8 idx)
|
|
|
|
{
|
2012-12-13 20:48:51 +00:00
|
|
|
gd->arch.used_laws &= ~(1 << idx);
|
2009-03-19 07:32:23 +00:00
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
out_be32(LAWAR_ADDR(idx), 0);
|
|
|
|
set_law_base_addr(idx, 0);
|
2009-03-19 07:32:23 +00:00
|
|
|
|
|
|
|
/* Read back so that we sync the writes */
|
2010-06-17 16:37:23 +00:00
|
|
|
in_be32(LAWAR_ADDR(idx));
|
2009-03-19 07:32:23 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-08-16 07:16:10 +00:00
|
|
|
#if !defined(CONFIG_NAND_SPL) && \
|
2022-05-13 16:26:35 +00:00
|
|
|
(!defined(CONFIG_SPL_BUILD) || !CONFIG_IS_ENABLED(INIT_MINIMAL))
|
2009-03-19 07:32:23 +00:00
|
|
|
static int get_law_entry(u8 i, struct law_entry *e)
|
|
|
|
{
|
2010-06-17 16:37:23 +00:00
|
|
|
u32 lawar;
|
2009-03-19 07:32:23 +00:00
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
lawar = in_be32(LAWAR_ADDR(i));
|
2009-03-19 07:32:23 +00:00
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
if (!(lawar & LAW_EN))
|
2009-03-19 07:32:23 +00:00
|
|
|
return 0;
|
|
|
|
|
2010-06-17 16:37:23 +00:00
|
|
|
e->addr = get_law_base_addr(i);
|
|
|
|
e->size = lawar & 0x3f;
|
|
|
|
e->trgt_id = (lawar >> 20) & 0xff;
|
2009-03-19 07:32:23 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-06-11 05:44:10 +00:00
|
|
|
int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
|
|
|
|
{
|
2012-12-13 20:48:51 +00:00
|
|
|
u32 idx = ffz(gd->arch.used_laws);
|
2008-06-11 05:44:10 +00:00
|
|
|
|
|
|
|
if (idx >= FSL_HW_NUM_LAWS)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
set_law(idx, addr, sz, id);
|
2008-06-10 21:16:02 +00:00
|
|
|
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
|
2013-08-16 07:16:10 +00:00
|
|
|
#if !defined(CONFIG_NAND_SPL) && \
|
2022-05-13 16:26:35 +00:00
|
|
|
(!defined(CONFIG_SPL_BUILD) || !CONFIG_IS_ENABLED(INIT_MINIMAL))
|
2008-06-10 21:16:02 +00:00
|
|
|
int set_last_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
|
|
|
|
{
|
|
|
|
u32 idx;
|
|
|
|
|
|
|
|
/* we have no LAWs free */
|
2012-12-13 20:48:51 +00:00
|
|
|
if (gd->arch.used_laws == -1)
|
2008-06-10 21:16:02 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* grab the last free law */
|
2012-12-13 20:48:51 +00:00
|
|
|
idx = __ilog2(~(gd->arch.used_laws));
|
2008-06-10 21:16:02 +00:00
|
|
|
|
|
|
|
if (idx >= FSL_HW_NUM_LAWS)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
set_law(idx, addr, sz, id);
|
2008-06-11 05:44:10 +00:00
|
|
|
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
struct law_entry find_law(phys_addr_t addr)
|
2008-01-16 07:13:58 +00:00
|
|
|
{
|
2009-03-19 07:32:23 +00:00
|
|
|
struct law_entry entry;
|
|
|
|
int i;
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
entry.index = -1;
|
|
|
|
entry.addr = 0;
|
|
|
|
entry.size = 0;
|
|
|
|
entry.trgt_id = 0;
|
2008-06-11 05:44:10 +00:00
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
for (i = 0; i < FSL_HW_NUM_LAWS; i++) {
|
|
|
|
u64 upper;
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
if (!get_law_entry(i, &entry))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
upper = entry.addr + (2ull << entry.size);
|
|
|
|
if ((addr >= entry.addr) && (addr < upper)) {
|
|
|
|
entry.index = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return entry;
|
2008-01-16 07:13:58 +00:00
|
|
|
}
|
|
|
|
|
2008-01-23 22:31:05 +00:00
|
|
|
void print_laws(void)
|
|
|
|
{
|
|
|
|
int i;
|
2010-06-17 16:37:23 +00:00
|
|
|
u32 lawar;
|
2008-01-23 22:31:05 +00:00
|
|
|
|
|
|
|
printf("\nLocal Access Window Configuration\n");
|
2010-06-17 16:37:23 +00:00
|
|
|
for (i = 0; i < FSL_HW_NUM_LAWS; i++) {
|
|
|
|
lawar = in_be32(LAWAR_ADDR(i));
|
2010-06-17 16:37:24 +00:00
|
|
|
#ifdef CONFIG_FSL_CORENET
|
|
|
|
printf("LAWBARH%02d: 0x%08x LAWBARL%02d: 0x%08x",
|
|
|
|
i, in_be32(LAWBARH_ADDR(i)),
|
|
|
|
i, in_be32(LAWBARL_ADDR(i)));
|
|
|
|
#else
|
2010-06-17 16:37:23 +00:00
|
|
|
printf("LAWBAR%02d: 0x%08x", i, in_be32(LAWBAR_ADDR(i)));
|
2010-06-17 16:37:24 +00:00
|
|
|
#endif
|
2011-02-12 21:34:08 +00:00
|
|
|
printf(" LAWAR%02d: 0x%08x\n", i, lawar);
|
2010-06-17 16:37:23 +00:00
|
|
|
printf("\t(EN: %d TGT: 0x%02x SIZE: ",
|
|
|
|
(lawar & LAW_EN) ? 1 : 0, (lawar >> 20) & 0xff);
|
|
|
|
print_size(lawar_size(lawar), ")\n");
|
2008-01-23 22:31:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-08-26 20:01:28 +00:00
|
|
|
/* use up to 2 LAWs for DDR, used the last available LAWs */
|
|
|
|
int set_ddr_laws(u64 start, u64 sz, enum law_trgt_if id)
|
|
|
|
{
|
|
|
|
u64 start_align, law_sz;
|
|
|
|
int law_sz_enc;
|
|
|
|
|
|
|
|
if (start == 0)
|
|
|
|
start_align = 1ull << (LAW_SIZE_32G + 1);
|
|
|
|
else
|
2016-01-22 10:20:10 +00:00
|
|
|
start_align = 1ull << (__ffs64(start));
|
2008-08-26 20:01:28 +00:00
|
|
|
law_sz = min(start_align, sz);
|
|
|
|
law_sz_enc = __ilog2_u64(law_sz) - 1;
|
|
|
|
|
|
|
|
if (set_last_law(start, law_sz_enc, id) < 0)
|
|
|
|
return -1;
|
|
|
|
|
2009-04-04 15:21:02 +00:00
|
|
|
/* recalculate size based on what was actually covered by the law */
|
|
|
|
law_sz = 1ull << __ilog2_u64(law_sz);
|
|
|
|
|
2008-08-26 20:01:28 +00:00
|
|
|
/* do we still have anything to map */
|
|
|
|
sz = sz - law_sz;
|
|
|
|
if (sz) {
|
|
|
|
start += law_sz;
|
|
|
|
|
2016-01-22 10:20:10 +00:00
|
|
|
start_align = 1ull << (__ffs64(start));
|
2008-08-26 20:01:28 +00:00
|
|
|
law_sz = min(start_align, sz);
|
|
|
|
law_sz_enc = __ilog2_u64(law_sz) - 1;
|
|
|
|
|
|
|
|
if (set_last_law(start, law_sz_enc, id) < 0)
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* do we still have anything to map */
|
|
|
|
sz = sz - law_sz;
|
|
|
|
if (sz)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2012-09-21 00:02:18 +00:00
|
|
|
#endif /* not SPL */
|
2008-08-26 20:01:28 +00:00
|
|
|
|
2014-04-08 13:42:46 +00:00
|
|
|
void disable_non_ddr_laws(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int id;
|
|
|
|
for (i = 0; i < FSL_HW_NUM_LAWS; i++) {
|
|
|
|
u32 lawar = in_be32(LAWAR_ADDR(i));
|
|
|
|
|
|
|
|
if (lawar & LAW_EN) {
|
|
|
|
id = (lawar & ~LAW_EN) >> 20;
|
|
|
|
switch (id) {
|
|
|
|
case LAW_TRGT_IF_DDR_1:
|
|
|
|
case LAW_TRGT_IF_DDR_2:
|
|
|
|
case LAW_TRGT_IF_DDR_3:
|
|
|
|
case LAW_TRGT_IF_DDR_4:
|
|
|
|
case LAW_TRGT_IF_DDR_INTRLV:
|
|
|
|
case LAW_TRGT_IF_DDR_INTLV_34:
|
|
|
|
case LAW_TRGT_IF_DDR_INTLV_123:
|
|
|
|
case LAW_TRGT_IF_DDR_INTLV_1234:
|
|
|
|
continue;
|
|
|
|
default:
|
|
|
|
disable_law(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-16 07:13:58 +00:00
|
|
|
void init_laws(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2009-03-19 07:32:23 +00:00
|
|
|
#if FSL_HW_NUM_LAWS < 32
|
2012-12-13 20:48:51 +00:00
|
|
|
gd->arch.used_laws = ~((1 << FSL_HW_NUM_LAWS) - 1);
|
2009-03-19 07:32:23 +00:00
|
|
|
#elif FSL_HW_NUM_LAWS == 32
|
2012-12-13 20:48:51 +00:00
|
|
|
gd->arch.used_laws = 0;
|
2009-03-19 07:32:23 +00:00
|
|
|
#else
|
|
|
|
#error FSL_HW_NUM_LAWS can not be greater than 32 w/o code changes
|
|
|
|
#endif
|
2008-01-16 07:13:58 +00:00
|
|
|
|
2019-11-07 16:11:39 +00:00
|
|
|
#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_E500) && \
|
2014-03-11 17:51:45 +00:00
|
|
|
!defined(CONFIG_E500MC)
|
|
|
|
/* ISBC (Boot ROM) creates a LAW 0 entry for non PBL platforms,
|
|
|
|
* which is not disabled before transferring the control to uboot.
|
|
|
|
* Disable the LAW 0 entry here.
|
|
|
|
*/
|
|
|
|
disable_law(0);
|
|
|
|
#endif
|
|
|
|
|
2019-11-07 16:11:39 +00:00
|
|
|
#if !defined(CONFIG_NXP_ESBC)
|
2014-04-08 13:42:46 +00:00
|
|
|
/*
|
|
|
|
* if any non DDR LAWs has been created earlier, remove them before
|
|
|
|
* LAW table is parsed.
|
|
|
|
*/
|
|
|
|
disable_non_ddr_laws();
|
|
|
|
#endif
|
2014-03-11 17:51:45 +00:00
|
|
|
|
2011-05-19 20:21:41 +00:00
|
|
|
/*
|
2011-02-03 15:02:13 +00:00
|
|
|
* Any LAWs that were set up before we booted assume they are meant to
|
|
|
|
* be around and mark them used.
|
|
|
|
*/
|
|
|
|
for (i = 0; i < FSL_HW_NUM_LAWS; i++) {
|
|
|
|
u32 lawar = in_be32(LAWAR_ADDR(i));
|
2011-05-19 20:21:41 +00:00
|
|
|
|
2011-02-03 15:02:13 +00:00
|
|
|
if (lawar & LAW_EN)
|
2012-12-13 20:48:51 +00:00
|
|
|
gd->arch.used_laws |= (1 << i);
|
2011-02-03 15:02:13 +00:00
|
|
|
}
|
|
|
|
|
2008-06-11 05:44:10 +00:00
|
|
|
for (i = 0; i < num_law_entries; i++) {
|
|
|
|
if (law_table[i].index == -1)
|
|
|
|
set_next_law(law_table[i].addr, law_table[i].size,
|
|
|
|
law_table[i].trgt_id);
|
|
|
|
else
|
|
|
|
set_law(law_table[i].index, law_table[i].addr,
|
|
|
|
law_table[i].size, law_table[i].trgt_id);
|
2008-01-16 07:13:58 +00:00
|
|
|
}
|
|
|
|
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
#ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
|
2012-08-09 05:10:00 +00:00
|
|
|
/* check RCW to get which port is used for boot */
|
2022-10-29 00:27:12 +00:00
|
|
|
ccsr_gur_t *gur = (void *)CFG_SYS_MPC85xx_GUTS_ADDR;
|
2012-08-09 05:10:00 +00:00
|
|
|
u32 bootloc = in_be32(&gur->rcwsr[6]);
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
/*
|
|
|
|
* in SRIO or PCIE boot we need to set specail LAWs for
|
|
|
|
* SRIO or PCIE interfaces.
|
|
|
|
*/
|
2012-08-09 05:10:00 +00:00
|
|
|
switch ((bootloc & FSL_CORENET_RCWSR6_BOOT_LOC) >> 23) {
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
case 0x0: /* boot from PCIE1 */
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_1);
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_1);
|
|
|
|
break;
|
|
|
|
case 0x1: /* boot from PCIE2 */
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_2);
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_2);
|
|
|
|
break;
|
|
|
|
case 0x2: /* boot from PCIE3 */
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_3);
|
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS,
|
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_PCIE_3);
|
|
|
|
break;
|
2012-08-09 05:10:00 +00:00
|
|
|
case 0x8: /* boot from SRIO1 */
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS,
|
2012-08-09 05:10:00 +00:00
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_RIO_1);
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS,
|
2012-08-09 05:10:00 +00:00
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_RIO_1);
|
|
|
|
break;
|
|
|
|
case 0x9: /* boot from SRIO2 */
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS,
|
2012-08-09 05:10:00 +00:00
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_RIO_2);
|
powerpc/corenet_ds: Slave module for boot from PCIE
When boot from PCIE, slave's core should be in holdoff after powered on for
some specific requirements. Master will release the slave's core at the
right time by PCIE interface.
Slave's ucode and ENV can be stored in master's memory space, then slave
can fetch them through PCIE interface. For the corenet platform, ucode is
for Fman.
NOTE: Because the slave can not erase, write master's NOR flash by
PCIE interface, so it can not modify the ENV parameters stored
in master's NOR flash using "saveenv" or other commands.
environment and requirement:
master:
1. NOR flash for its own u-boot image, ucode and ENV space.
2. Slave's u-boot image is in master NOR flash.
3. Put the slave's ucode and ENV into it's own memory space.
4. Normally boot from local NOR flash.
5. Configure PCIE system if needed.
slave:
1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV.
2. Boot location should be set to one PCIE interface by RCW.
3. RCW should configure the SerDes, PCIE interfaces correctly.
4. Must set all the cores in holdoff by RCW.
5. Must be powered on before master's boot.
For the slave module, need to finish these processes:
1. Set the boot location to one PCIE interface by RCW.
2. Set a specific TLB entry for the boot process.
3. Set a LAW entry with the TargetID of one PCIE for the boot.
4. Set a specific TLB entry in order to fetch ucode and ENV from
master.
5. Set a LAW entry with the TargetID one of the PCIE ports for
ucode and ENV.
6. Slave's u-boot image should be generated specifically by
make xxxx_SRIO_PCIE_BOOT_config.
This will set SYS_TEXT_BASE=0xFFF80000 and other configurations.
In addition, the processes are very similar between boot from SRIO and
boot from PCIE. Some configurations like the address spaces can be set to
the same. So the module of boot from PCIE was added based on the existing
module of boot from SRIO, and the following changes were needed:
1. Updated the README.srio-boot-corenet to add descriptions about
boot from PCIE, and change the name to
README.srio-pcie-boot-corenet.
2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to
"xxxx_SRIO_PCIE_BOOT", and the image builded with
"xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and
from PCIE.
3. Updated other macros and documents if needed to add information
about boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-09 05:10:03 +00:00
|
|
|
set_next_law(CONFIG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS,
|
2012-08-09 05:10:00 +00:00
|
|
|
LAW_SIZE_1M,
|
|
|
|
LAW_TRGT_IF_RIO_2);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-26 04:40:07 +00:00
|
|
|
return;
|
2008-01-16 07:13:58 +00:00
|
|
|
}
|