diff options
author | Liu Gang <Gang.Liu@freescale.com> | 2012-08-09 05:10:00 +0000 |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2012-08-23 10:24:14 -0500 |
commit | 81fa73bab05f491dd6f27c9afbc6952f54173b41 (patch) | |
tree | 8c10a983633f7cb3f5e3bdee8ab634094a3c36af /drivers | |
parent | ff65f12699b4181b777cbc03b057510bc4605f5e (diff) | |
download | u-boot-imx-81fa73bab05f491dd6f27c9afbc6952f54173b41.zip u-boot-imx-81fa73bab05f491dd6f27c9afbc6952f54173b41.tar.gz u-boot-imx-81fa73bab05f491dd6f27c9afbc6952f54173b41.tar.bz2 |
powerpc/corenet_ds: Get rid of the CONFIG_SRIOBOOT_SLAVE_PORTx macro
When compile the slave image for boot from SRIO, no longer need to
specify which SRIO port it will boot from. The code will get this
information from RCW and then finishes corresponding configurations.
This has the following advantages:
1. No longer need to rebuild an image when change the SRIO port for
boot from SRIO, just rewrite the new RCW with selected port,
then the code will get the port information by reading new RCW.
2. It will be easier to support other boot location options, for
example, boot from PCIE.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/fsl_law.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c index a7d04b7..a71a0ce 100644 --- a/drivers/misc/fsl_law.c +++ b/drivers/misc/fsl_law.c @@ -275,5 +275,32 @@ void init_laws(void) law_table[i].size, law_table[i].trgt_id); } +#ifdef CONFIG_SRIOBOOT_SLAVE + /* check RCW to get which port is used for boot */ + ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; + u32 bootloc = in_be32(&gur->rcwsr[6]); + /* in SRIO boot we need to set specail LAWs for SRIO interfaces */ + switch ((bootloc & FSL_CORENET_RCWSR6_BOOT_LOC) >> 23) { + case 0x8: /* boot from SRIO1 */ + set_next_law(CONFIG_SYS_SRIOBOOT_SLAVE_ADDR_PHYS, + LAW_SIZE_1M, + LAW_TRGT_IF_RIO_1); + set_next_law(CONFIG_SYS_SRIOBOOT_UCODE_ENV_ADDR_PHYS, + LAW_SIZE_1M, + LAW_TRGT_IF_RIO_1); + break; + case 0x9: /* boot from SRIO2 */ + set_next_law(CONFIG_SYS_SRIOBOOT_SLAVE_ADDR_PHYS, + LAW_SIZE_1M, + LAW_TRGT_IF_RIO_2); + set_next_law(CONFIG_SYS_SRIOBOOT_UCODE_ENV_ADDR_PHYS, + LAW_SIZE_1M, + LAW_TRGT_IF_RIO_2); + break; + default: + break; + } +#endif + return ; } |