summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorOmri Itach <omrii@marvell.com>2017-05-17 11:04:26 +0300
committerKostya Porotchkin <kostap@marvell.com>2017-05-22 14:03:30 +0300
commit380119d739002a7f9cdc7f730fcaa42f89f8e44b (patch)
tree432b01726cf1d0a1ca6d468ba711b84087cf8c26 /drivers
parent3cf300e7695e6883787ce01d5c4b97ced96bb8c1 (diff)
fix: mci: ap806: skip setting MCI ID assignment when booting from MCI
When boot source is from MCI, bootROM is already enabling MCI simultaneous transactions (ID assignment), so in that case we must avoid enabling it for the 2nd time (according to design guidelines). Change-Id: I3967fc3526e27356f9e8ebf184b52cc21003e3c1 Signed-off-by: Omri Itach <omrii@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39557 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com> (cherry picked from commit c721c97f7ea0724d3eaed92168897db4fc1b9b03) Reviewed-on: http://vgitil04.il.marvell.com:8080/39795
Diffstat (limited to 'drivers')
-rw-r--r--drivers/marvell/mci.c17
-rw-r--r--drivers/marvell/mochi/apn806_setup.c8
2 files changed, 21 insertions, 4 deletions
diff --git a/drivers/marvell/mci.c b/drivers/marvell/mci.c
index b9815161..81d7d5ea 100644
--- a/drivers/marvell/mci.c
+++ b/drivers/marvell/mci.c
@@ -496,10 +496,19 @@ int mci_configure_a1(int mci_index)
{
int rval;
- /* set MCI to support read/write transactions to arrive at the same time */
- rval = mci_enable_simultaneous_transactions(mci_index);
- if (rval)
- ERROR("Failed to set MCI for simultaneous read/write transactions\n");
+ /* When boot source is from MCI, then bootROM is already enabling MCI
+ * simultaneous transactions (ID assignment), so in that case we must avoid
+ * enabling it for the 2nd time.
+ */
+ if (apn806_sar_get_bootsrc() != SAR_MCIX4) {
+ VERBOSE("MCI is not used for boot source: configuring MCI ID assignment\n");
+ /* set MCI to support read/write transactions to arrive at the same time */
+ rval = mci_enable_simultaneous_transactions(mci_index);
+ if (rval)
+ ERROR("Failed to set MCI for simultaneous read/write transactions\n");
+ }
+ else
+ VERBOSE("MCI is used for boot source: skipping MCI ID assignment\n");
/* enable PHY register mode read/write access */
mci_enable_phy_regs_access(mci_index);
diff --git a/drivers/marvell/mochi/apn806_setup.c b/drivers/marvell/mochi/apn806_setup.c
index 03ba5872..fb2f4e4b 100644
--- a/drivers/marvell/mochi/apn806_setup.c
+++ b/drivers/marvell/mochi/apn806_setup.c
@@ -87,6 +87,14 @@ enum axi_attr {
AXI_MAX_ATTR,
};
+uint32_t apn806_sar_get_bootsrc()
+{
+ uint32_t reg;
+
+ reg = mmio_read_32(AP806_SAR0_REG_BASE);
+ return (reg >> AP806_SAR0_BOOT_SOURCE_OFFSET) & AP806_SAR0_BOOT_SOURCE_MASK;
+}
+
static void apn_sec_masters_access_en(uint32_t enable)
{
uint32_t reg;