Merge changes I80316689,I23cac4fb,If911e7de,I169ff358,I4e040cd5, ... into integration
* changes:
ddr: a80x0: add DDR 32-bit ECC mode support
ble: ap807: improve PLL configuration sequence
ble: ap807: clean-up PLL configuration sequence
ddr: a80x0: add DDR 32-bit mode support
plat: marvell: mci: perform mci link tuning for all mci interfaces
plat: marvell: mci: use more meaningful name for mci link tuning
plat: marvell: a8k: remove wrong or unnecessary comments
plat: marvell: ap807: enable snoop filter for ap807
plat: marvell: ap807: update configuration space of each CP
plat: marvell: ap807: use correct address for MCIx4 register
plat: marvell: add support for PLL 2.2GHz mode
plat: marvell: armada: make a8k_common.mk and mss_common.mk more generic
marvell: armada: add extra level in marvell platform hierarchy
diff --git a/docs/plat/marvell/build.rst b/docs/plat/marvell/armada/build.rst
similarity index 97%
rename from docs/plat/marvell/build.rst
rename to docs/plat/marvell/armada/build.rst
index c10bcff..6f28721 100644
--- a/docs/plat/marvell/build.rst
+++ b/docs/plat/marvell/armada/build.rst
@@ -84,7 +84,7 @@
- BLE_PATH
Points to BLE (Binary ROM extension) sources folder. Only required for A8K builds.
- The parameter is optional, its default value is ``plat/marvell/a8k/common/ble``.
+ The parameter is optional, its default value is ``plat/marvell/armada/a8k/common/ble``.
- MV_DDR_PATH
@@ -192,7 +192,11 @@
In order to build UART recovery image this operation should be disabled for
a70x0 and a80x0 because of hardware limitation (boot from secondary image
can interrupt UART recovery process). This MACRO definition is set in
- ``plat/marvell/a8k/common/include/platform_def.h`` file.
+ ``plat/marvell/armada/a8k/common/include/platform_def.h`` file.
+
+- DDR32
+ In order to work in 32bit DDR, instead of the default 64bit ECC DDR,
+ this flag should be set to 1.
For more information about build options, please refer to the
:ref:`Build Options` document.
diff --git a/docs/plat/marvell/misc/mvebu-a8k-addr-map.rst b/docs/plat/marvell/armada/misc/mvebu-a8k-addr-map.rst
similarity index 100%
rename from docs/plat/marvell/misc/mvebu-a8k-addr-map.rst
rename to docs/plat/marvell/armada/misc/mvebu-a8k-addr-map.rst
diff --git a/docs/plat/marvell/misc/mvebu-amb.rst b/docs/plat/marvell/armada/misc/mvebu-amb.rst
similarity index 100%
rename from docs/plat/marvell/misc/mvebu-amb.rst
rename to docs/plat/marvell/armada/misc/mvebu-amb.rst
diff --git a/docs/plat/marvell/misc/mvebu-ccu.rst b/docs/plat/marvell/armada/misc/mvebu-ccu.rst
similarity index 100%
rename from docs/plat/marvell/misc/mvebu-ccu.rst
rename to docs/plat/marvell/armada/misc/mvebu-ccu.rst
diff --git a/docs/plat/marvell/misc/mvebu-io-win.rst b/docs/plat/marvell/armada/misc/mvebu-io-win.rst
similarity index 100%
rename from docs/plat/marvell/misc/mvebu-io-win.rst
rename to docs/plat/marvell/armada/misc/mvebu-io-win.rst
diff --git a/docs/plat/marvell/misc/mvebu-iob.rst b/docs/plat/marvell/armada/misc/mvebu-iob.rst
similarity index 100%
rename from docs/plat/marvell/misc/mvebu-iob.rst
rename to docs/plat/marvell/armada/misc/mvebu-iob.rst
diff --git a/docs/plat/marvell/porting.rst b/docs/plat/marvell/armada/porting.rst
similarity index 90%
rename from docs/plat/marvell/porting.rst
rename to docs/plat/marvell/armada/porting.rst
index 0a71dbd..1723ebb 100644
--- a/docs/plat/marvell/porting.rst
+++ b/docs/plat/marvell/armada/porting.rst
@@ -8,13 +8,13 @@
Source Code Structure
---------------------
-- The customer platform specific code shall reside under ``plat/marvell/<soc family>/<soc>_cust``
- (e.g. 'plat/marvell/a8k/a7040_cust').
+- The customer platform specific code shall reside under ``plat/marvell/armada/<soc family>/<soc>_cust``
+ (e.g. 'plat/marvell/armada/a8k/a7040_cust').
- The platform name for build purposes is called ``<soc>_cust`` (e.g. ``a7040_cust``).
- The build system will reuse all files from within the soc directory, and take only the porting
files from the customer platform directory.
-Files that require porting are located at ``plat/marvell/<soc family>/<soc>_cust`` directory.
+Files that require porting are located at ``plat/marvell/armada/<soc family>/<soc>_cust`` directory.
Armada-70x0/Armada-80x0 Porting
@@ -64,7 +64,7 @@
- Example:
In A7040-DB specific implementation
-(``plat/marvell/a8k/a70x0/board/marvell_plat_config.c``), the image skip is
+(``plat/marvell/armada/a8k/a70x0/board/marvell_plat_config.c``), the image skip is
implemented using GPIO: mpp 33 (SW5).
Before resetting the board make sure there is a valid image on the next flash
@@ -91,7 +91,7 @@
the boot process.
Each supported platform of the TF-A has its own DDR porting file called
-dram_port.c located at ``atf/plat/marvell/a8k/<platform>/board`` directory.
+dram_port.c located at ``atf/plat/marvell/armada/a8k/<platform>/board`` directory.
Please refer to '<path_to_mv_ddr_sources>/doc/porting_guide.txt' for detailed
porting description.
@@ -128,7 +128,7 @@
The porting layer for PHY was introduced in TF-A. There is one file
``drivers/marvell/comphy/phy-default-porting-layer.h`` which contains the
defaults. Those default parameters are used only if there is no appropriate
- phy-porting-layer.h file under: ``plat/marvell/<soc
+ phy-porting-layer.h file under: ``plat/marvell/armada/<soc
family>/<platform>/board/phy-porting-layer.h``. If the phy-porting-layer.h
exists, the phy-default-porting-layer.h is not going to be included.
@@ -140,7 +140,7 @@
The easiest way to prepare the PHY porting layer for custom board is to copy
existing example to a new platform:
- - cp ``plat/marvell/a8k/a80x0/board/phy-porting-layer.h`` "plat/marvell/<soc family>/<platform>/board/phy-porting-layer.h"
+ - cp ``plat/marvell/armada/a8k/a80x0/board/phy-porting-layer.h`` "plat/marvell/armada/<soc family>/<platform>/board/phy-porting-layer.h"
- adjust relevant parameters or
- if different comphy index is used for specific feature, move it to proper table entry and then adjust.
@@ -150,7 +150,7 @@
- Example:
Example porting layer for armada-8040-db is under:
- ``plat/marvell/a8k/a80x0/board/phy-porting-layer.h``
+ ``plat/marvell/armada/a8k/a80x0/board/phy-porting-layer.h``
.. note::
If there is no PHY porting layer for new platform (missing
diff --git a/docs/plat/marvell/index.rst b/docs/plat/marvell/index.rst
index 89ebdc0..0d33432 100644
--- a/docs/plat/marvell/index.rst
+++ b/docs/plat/marvell/index.rst
@@ -5,10 +5,10 @@
:maxdepth: 1
:caption: Contents
- build
- porting
- misc/mvebu-a8k-addr-map
- misc/mvebu-amb
- misc/mvebu-ccu
- misc/mvebu-io-win
- misc/mvebu-iob
+ armada/build
+ armada/porting
+ armada/misc/mvebu-a8k-addr-map
+ armada/misc/mvebu-amb
+ armada/misc/mvebu-ccu
+ armada/misc/mvebu-io-win
+ armada/misc/mvebu-iob
diff --git a/drivers/marvell/ap807_clocks_init.c b/drivers/marvell/ap807_clocks_init.c
index 04c256b..c1f8619 100644
--- a/drivers/marvell/ap807_clocks_init.c
+++ b/drivers/marvell/ap807_clocks_init.c
@@ -39,19 +39,29 @@
#define AP807_CPU_PLL_PARAM(cluster) AP807_CPU_PLL_CTRL(cluster)
#define AP807_CPU_PLL_CFG(cluster) (AP807_CPU_PLL_CTRL(cluster) + 0x4)
#define AP807_CPU_PLL_CFG_BYPASS_MODE (0x1)
+#define AP807_CPU_PLL_FRC_DSCHG (0x2)
#define AP807_CPU_PLL_CFG_USE_REG_FILE (0x1 << 9)
static void pll_set_freq(unsigned int freq_val)
{
int i;
+ if (freq_val != PLL_FREQ_2200)
+ return;
+
for (i = 0 ; i < AP807_CLUSTER_NUM ; i++) {
- mmio_write_32(AP807_CPU_PLL_CFG(i),
- AP807_CPU_PLL_CFG_USE_REG_FILE);
- mmio_write_32(AP807_CPU_PLL_CFG(i),
- AP807_CPU_PLL_CFG_USE_REG_FILE |
- AP807_CPU_PLL_CFG_BYPASS_MODE);
+ /* Set parameter of cluster i PLL to 2.2GHz */
mmio_write_32(AP807_CPU_PLL_PARAM(i), freq_val);
+ /* Set apll_lpf_frc_dschg - Control
+ * voltage of internal VCO is discharged
+ */
+ mmio_write_32(AP807_CPU_PLL_CFG(i),
+ AP807_CPU_PLL_FRC_DSCHG);
+ /* Set use_rf_conf load PLL parameter from register */
+ mmio_write_32(AP807_CPU_PLL_CFG(i),
+ AP807_CPU_PLL_FRC_DSCHG |
+ AP807_CPU_PLL_CFG_USE_REG_FILE);
+ /* Un-set apll_lpf_frc_dschg */
mmio_write_32(AP807_CPU_PLL_CFG(i),
AP807_CPU_PLL_CFG_USE_REG_FILE);
}
@@ -84,19 +94,16 @@
*/
void ap807_clocks_init(unsigned int freq_option)
{
- /* Switch from ARO to PLL */
- aro_to_pll();
-
/* Modifications in frequency table:
* 0x0: 764x: change to 2000 MHz.
* 0x2: 744x change to 1800 MHz, 764x change to 2200/2400.
* 0x3: 3900/744x/764x change to 1200 MHz.
*/
- switch (freq_option) {
- case CPU_2000_DDR_1200_RCLK_1200:
- pll_set_freq(PLL_FREQ_2000);
- break;
- default:
- break;
- }
+
+ if (freq_option == CPU_2200_DDR_1200_RCLK_1200)
+ pll_set_freq(PLL_FREQ_2200);
+
+ /* Switch from ARO to PLL */
+ aro_to_pll();
+
}
diff --git a/drivers/marvell/comphy/phy-comphy-cp110.c b/drivers/marvell/comphy/phy-comphy-cp110.c
index 384dd39..b682086 100644
--- a/drivers/marvell/comphy/phy-comphy-cp110.c
+++ b/drivers/marvell/comphy/phy-comphy-cp110.c
@@ -2236,7 +2236,7 @@
printf("########################################################\n");
printf("# To use trained values update the ATF sources:\n");
- printf("# plat/marvell/a8k/<board_type>/board/phy-porting-layer.h ");
+ printf("# plat/marvell/armada/a8k/<board_type>/board/phy-porting-layer.h ");
printf("file\n# with new values as below (for appropriate AP nr %d",
ap_nr);
printf("and CP nr: %d comphy_index %d\n\n",
diff --git a/drivers/marvell/comphy/phy-comphy-cp110.h b/drivers/marvell/comphy/phy-comphy-cp110.h
index 407909b..63aef12 100644
--- a/drivers/marvell/comphy/phy-comphy-cp110.h
+++ b/drivers/marvell/comphy/phy-comphy-cp110.h
@@ -7,7 +7,7 @@
/* Those are parameters for xfi mode, which need to be tune for each board type.
* For known DB boards the parameters was already calibrated and placed under
- * the plat/marvell/a8k/<board_type>/board/phy-porting-layer.h
+ * the plat/marvell/armada/a8k/<board_type>/board/phy-porting-layer.h
*/
struct xfi_params {
uint8_t g1_ffe_res_sel;
diff --git a/drivers/marvell/mci.c b/drivers/marvell/mci.c
index 06fe88e..2b54700 100644
--- a/drivers/marvell/mci.c
+++ b/drivers/marvell/mci.c
@@ -571,21 +571,21 @@
debug_enter();
/* ID assignment (assigning global ID offset to CP) */
- mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(0),
+ mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(mci_index),
MCI_DID_GLOBAL_ASSIGN_REQ_MCI_LOCAL_ID(2) |
MCI_DID_GLOBAL_ASSIGN_REQ_MCI_COUNT(2) |
MCI_DID_GLOBAL_ASSIGN_REQ_HOPS_NUM(2));
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_DID_GLOBAL_ASSIGNMENT_REQUEST_REG) |
MCI_INDIRECT_CTRL_ASSIGN_CMD);
ret |= mci_poll_command_completion(mci_index, MCI_CMD_WRITE);
/* Assigning dest. ID=3 to all transactions entering from AXI at AP */
- mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(0),
+ mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(mci_index),
MCI_HB_CTRL_WIN0_DEST_VALID_FLAG(1) |
MCI_HB_CTRL_WIN0_DEST_ID(3));
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_HB_CTRL_WIN0_DESTINATION_REG_NUM) |
MCI_INDIRECT_CTRL_HOPID(GID_AXI_HB) |
@@ -593,10 +593,10 @@
ret |= mci_poll_command_completion(mci_index, MCI_CMD_WRITE);
/* Assigning dest. ID=1 to all transactions entering from AXI at CP */
- mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(0),
+ mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(mci_index),
MCI_HB_CTRL_WIN0_DEST_VALID_FLAG(1) |
MCI_HB_CTRL_WIN0_DEST_ID(1));
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_HB_CTRL_WIN0_DESTINATION_REG_NUM) |
MCI_INDIRECT_CTRL_HOPID(GID_IHB_EXT) |
@@ -607,8 +607,8 @@
* This will lead to get match for any AXI address
* and receive destination ID=3
*/
- mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(0), 0xffffffff);
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(mci_index), 0xffffffff);
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_HB_CTRL_WIN0_ADDRESS_MASK_REG_NUM) |
MCI_INDIRECT_CTRL_HOPID(GID_AXI_HB) |
@@ -619,8 +619,8 @@
* This will lead to get match for any AXI address
* and receive destination ID=1
*/
- mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(0), 0xffffffff);
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_WRITE_READ_DATA_REG(mci_index), 0xffffffff);
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_HB_CTRL_WIN0_ADDRESS_MASK_REG_NUM) |
MCI_INDIRECT_CTRL_HOPID(GID_IHB_EXT) |
@@ -653,7 +653,7 @@
* performed by BootROM.
*/
debug_enter();
- mci_mmio_write_32(MCI_ACCESS_CMD_REG(0),
+ mci_mmio_write_32(MCI_ACCESS_CMD_REG(mci_index),
MCI_INDIRECT_REG_CTRL_ADDR(
MCI_HB_CTRL_WIN0_DESTINATION_REG_NUM) |
MCI_INDIRECT_CTRL_HOPID(GID_AXI_HB) |
@@ -697,7 +697,8 @@
* wasn't already enabled in bootrom.
*/
if (mci_simulatenous_trans_missing(mci_index)) {
- VERBOSE("Enabling MCI simultaneous transaction\n");
+ VERBOSE("Enabling MCI simultaneous transaction for mci%d\n",
+ mci_index);
/* set MCI to support read/write transactions
* to arrive at the same time
*/
@@ -819,7 +820,7 @@
}
/* Initialize MCI for performance improvements */
-int mci_initialize(int mci_index)
+int mci_link_tune(int mci_index)
{
int ret;
diff --git a/drivers/marvell/mochi/ap807_setup.c b/drivers/marvell/mochi/ap807_setup.c
index 864c923..7b68195 100644
--- a/drivers/marvell/mochi/ap807_setup.c
+++ b/drivers/marvell/mochi/ap807_setup.c
@@ -11,6 +11,7 @@
#include <drivers/marvell/cache_llc.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/io_win.h>
+#include <drivers/marvell/iob.h>
#include <drivers/marvell/mci.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <lib/mmio.h>
@@ -31,6 +32,11 @@
#define DSS_CR0 (MVEBU_RFU_BASE + 0x100)
#define DVM_48BIT_VA_ENABLE (1 << 21)
+
+/* SoC RFU / IHBx4 Control */
+#define MCIX4_807_REG_START_ADDR_REG(unit_id) (MVEBU_RFU_BASE + \
+ 0x4258 + (unit_id * 0x4))
+
/* Secure MoChi incoming access */
#define SEC_MOCHI_IN_ACC_REG (MVEBU_RFU_BASE + 0x4738)
#define SEC_MOCHI_IN_ACC_IHB0_EN (1)
@@ -124,7 +130,7 @@
uint32_t mci;
for (mci = 0; mci < MCI_MAX_UNIT_ID; mci++)
- mmio_write_32(MCIX4_REG_START_ADDRESS_REG(mci),
+ mmio_write_32(MCIX4_807_REG_START_ADDR_REG(mci),
MVEBU_MCI_REG_BASE_REMAP(mci) >>
MCI_REMAP_OFF_SHIFT);
}
@@ -186,6 +192,38 @@
mmio_write_32(MVEBU_SYSRST_OUT_CONFIG_REG, reg);
}
+/*
+ * By default all external CPs start with configuration address space set to
+ * 0xf200_0000. To overcome this issue, go in the loop and initialize the
+ * CP one by one, using temporary window configuration which allows to access
+ * each CP and update its configuration space according to decoding
+ * windows scheme defined for each platform.
+ */
+void update_cp110_default_win(int cp_id)
+{
+ int mci_id = cp_id - 1;
+ uintptr_t cp110_base, cp110_temp_base;
+
+ /* CP110 default configuration address space */
+ cp110_temp_base = MVEBU_AP_IO_BASE(MVEBU_AP0);
+
+ struct addr_map_win iowin_temp_win = {
+ .base_addr = cp110_temp_base,
+ .win_size = MVEBU_CP_OFFSET,
+ };
+
+ iowin_temp_win.target_id = mci_id;
+ iow_temp_win_insert(0, &iowin_temp_win, 1);
+
+ /* Calculate the new CP110 - base address */
+ cp110_base = MVEBU_CP_REGS_BASE(cp_id);
+ /* Go and update the CP110 configuration address space */
+ iob_cfg_space_update(0, cp_id, cp110_temp_base, cp110_base);
+
+ /* Remove the temporary IO-WIN window */
+ iow_temp_win_remove(0, &iowin_temp_win, 1);
+}
+
void ap_init(void)
{
/* Setup Aurora2. */
diff --git a/drivers/marvell/mochi/apn806_setup.c b/drivers/marvell/mochi/apn806_setup.c
index 1e91c43..1a02bd4 100644
--- a/drivers/marvell/mochi/apn806_setup.c
+++ b/drivers/marvell/mochi/apn806_setup.c
@@ -250,3 +250,6 @@
return 1;
}
+void update_cp110_default_win(int cp_id)
+{
+}
diff --git a/include/drivers/marvell/aro.h b/include/drivers/marvell/aro.h
index c16f625..4d1094a 100644
--- a/include/drivers/marvell/aro.h
+++ b/include/drivers/marvell/aro.h
@@ -21,11 +21,13 @@
DDR_FREQ_SAR
};
+#include <mvebu_def.h>
+
enum cpu_clock_freq_mode {
CPU_2000_DDR_1200_RCLK_1200 = 0x0,
CPU_2000_DDR_1050_RCLK_1050 = 0x1,
CPU_1600_DDR_800_RCLK_800 = 0x4,
- CPU_1800_DDR_1200_RCLK_1200 = 0x6,
+ CPU_2200_DDR_1200_RCLK_1200 = 0x6,
CPU_1800_DDR_1050_RCLK_1050 = 0x7,
CPU_1600_DDR_900_RCLK_900 = 0x0B,
CPU_1600_DDR_1050_RCLK_1050 = 0x0D,
diff --git a/include/drivers/marvell/mci.h b/include/drivers/marvell/mci.h
index 8ef0234..af5d620 100644
--- a/include/drivers/marvell/mci.h
+++ b/include/drivers/marvell/mci.h
@@ -10,7 +10,7 @@
#ifndef MCI_H
#define MCI_H
-int mci_initialize(int mci_index);
+int mci_link_tune(int mci_index);
void mci_turn_link_down(void);
void mci_turn_link_on(void);
int mci_get_link_status(void);
diff --git a/include/drivers/marvell/mochi/ap_setup.h b/include/drivers/marvell/mochi/ap_setup.h
index eff4473..5b0e75f 100644
--- a/include/drivers/marvell/mochi/ap_setup.h
+++ b/include/drivers/marvell/mochi/ap_setup.h
@@ -13,5 +13,6 @@
void ap_init(void);
void ap_ble_init(void);
int ap_get_count(void);
+void update_cp110_default_win(int cp_id);
#endif /* AP_SETUP_H */
diff --git a/include/plat/marvell/a3700/common/armada_common.h b/include/plat/marvell/armada/a3700/common/armada_common.h
similarity index 100%
rename from include/plat/marvell/a3700/common/armada_common.h
rename to include/plat/marvell/armada/a3700/common/armada_common.h
diff --git a/include/plat/marvell/a3700/common/board_marvell_def.h b/include/plat/marvell/armada/a3700/common/board_marvell_def.h
similarity index 100%
rename from include/plat/marvell/a3700/common/board_marvell_def.h
rename to include/plat/marvell/armada/a3700/common/board_marvell_def.h
diff --git a/include/plat/marvell/a3700/common/marvell_def.h b/include/plat/marvell/armada/a3700/common/marvell_def.h
similarity index 100%
rename from include/plat/marvell/a3700/common/marvell_def.h
rename to include/plat/marvell/armada/a3700/common/marvell_def.h
diff --git a/include/plat/marvell/a3700/common/plat_marvell.h b/include/plat/marvell/armada/a3700/common/plat_marvell.h
similarity index 100%
rename from include/plat/marvell/a3700/common/plat_marvell.h
rename to include/plat/marvell/armada/a3700/common/plat_marvell.h
diff --git a/include/plat/marvell/a8k/common/armada_common.h b/include/plat/marvell/armada/a8k/common/armada_common.h
similarity index 100%
rename from include/plat/marvell/a8k/common/armada_common.h
rename to include/plat/marvell/armada/a8k/common/armada_common.h
diff --git a/include/plat/marvell/a8k/common/board_marvell_def.h b/include/plat/marvell/armada/a8k/common/board_marvell_def.h
similarity index 100%
rename from include/plat/marvell/a8k/common/board_marvell_def.h
rename to include/plat/marvell/armada/a8k/common/board_marvell_def.h
diff --git a/include/plat/marvell/a8k/common/marvell_def.h b/include/plat/marvell/armada/a8k/common/marvell_def.h
similarity index 100%
rename from include/plat/marvell/a8k/common/marvell_def.h
rename to include/plat/marvell/armada/a8k/common/marvell_def.h
diff --git a/include/plat/marvell/a8k/common/plat_marvell.h b/include/plat/marvell/armada/a8k/common/plat_marvell.h
similarity index 100%
rename from include/plat/marvell/a8k/common/plat_marvell.h
rename to include/plat/marvell/armada/a8k/common/plat_marvell.h
diff --git a/include/plat/marvell/a8k/common/plat_pm_trace.h b/include/plat/marvell/armada/a8k/common/plat_pm_trace.h
similarity index 100%
rename from include/plat/marvell/a8k/common/plat_pm_trace.h
rename to include/plat/marvell/armada/a8k/common/plat_pm_trace.h
diff --git a/include/plat/marvell/common/aarch64/cci_macros.S b/include/plat/marvell/armada/common/aarch64/cci_macros.S
similarity index 100%
rename from include/plat/marvell/common/aarch64/cci_macros.S
rename to include/plat/marvell/armada/common/aarch64/cci_macros.S
diff --git a/include/plat/marvell/common/aarch64/marvell_macros.S b/include/plat/marvell/armada/common/aarch64/marvell_macros.S
similarity index 100%
rename from include/plat/marvell/common/aarch64/marvell_macros.S
rename to include/plat/marvell/armada/common/aarch64/marvell_macros.S
diff --git a/include/plat/marvell/common/marvell_plat_priv.h b/include/plat/marvell/armada/common/marvell_plat_priv.h
similarity index 100%
rename from include/plat/marvell/common/marvell_plat_priv.h
rename to include/plat/marvell/armada/common/marvell_plat_priv.h
diff --git a/include/plat/marvell/common/marvell_pm.h b/include/plat/marvell/armada/common/marvell_pm.h
similarity index 100%
rename from include/plat/marvell/common/marvell_pm.h
rename to include/plat/marvell/armada/common/marvell_pm.h
diff --git a/include/plat/marvell/common/mvebu.h b/include/plat/marvell/armada/common/mvebu.h
similarity index 100%
rename from include/plat/marvell/common/mvebu.h
rename to include/plat/marvell/armada/common/mvebu.h
diff --git a/plat/marvell/a3700/a3700/platform.mk b/plat/marvell/a3700/a3700/platform.mk
deleted file mode 100644
index 4f7ac08..0000000
--- a/plat/marvell/a3700/a3700/platform.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright (C) 2018 Marvell International Ltd.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-# https://spdx.org/licenses
-#
-
-include plat/marvell/a3700/common/a3700_common.mk
-
-include plat/marvell/common/marvell_common.mk
diff --git a/plat/marvell/a8k/a70x0_amc/platform.mk b/plat/marvell/a8k/a70x0_amc/platform.mk
deleted file mode 100644
index d3a0167..0000000
--- a/plat/marvell/a8k/a70x0_amc/platform.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2018 Marvell International Ltd.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-# https://spdx.org/licenses
-#
-
-PCI_EP_SUPPORT := 0
-
-CP_NUM := 1
-$(eval $(call add_define,CP_NUM))
-
-DOIMAGE_SEC := tools/doimage/secure/sec_img_7K.cfg
-
-MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-
-include plat/marvell/a8k/common/a8k_common.mk
-
-include plat/marvell/common/marvell_common.mk
diff --git a/plat/marvell/a8k/a80x0/platform.mk b/plat/marvell/a8k/a80x0/platform.mk
deleted file mode 100644
index 00d24b2..0000000
--- a/plat/marvell/a8k/a80x0/platform.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2018 Marvell International Ltd.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-# https://spdx.org/licenses
-#
-
-PCI_EP_SUPPORT := 0
-
-CP_NUM := 2
-$(eval $(call add_define,CP_NUM))
-
-DOIMAGE_SEC := tools/doimage/secure/sec_img_8K.cfg
-
-MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-
-include plat/marvell/a8k/common/a8k_common.mk
-
-include plat/marvell/common/marvell_common.mk
-PLAT_INCLUDES += -Iplat/marvell/a8k/a80x0/board
diff --git a/plat/marvell/a3700/a3700/board/pm_src.c b/plat/marvell/armada/a3700/a3700/board/pm_src.c
similarity index 100%
rename from plat/marvell/a3700/a3700/board/pm_src.c
rename to plat/marvell/armada/a3700/a3700/board/pm_src.c
diff --git a/plat/marvell/a3700/a3700/mvebu_def.h b/plat/marvell/armada/a3700/a3700/mvebu_def.h
similarity index 100%
rename from plat/marvell/a3700/a3700/mvebu_def.h
rename to plat/marvell/armada/a3700/a3700/mvebu_def.h
diff --git a/plat/marvell/a3700/a3700/plat_bl31_setup.c b/plat/marvell/armada/a3700/a3700/plat_bl31_setup.c
similarity index 100%
rename from plat/marvell/a3700/a3700/plat_bl31_setup.c
rename to plat/marvell/armada/a3700/a3700/plat_bl31_setup.c
diff --git a/plat/marvell/armada/a3700/a3700/platform.mk b/plat/marvell/armada/a3700/a3700/platform.mk
new file mode 100644
index 0000000..bd9464a
--- /dev/null
+++ b/plat/marvell/armada/a3700/a3700/platform.mk
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2018 Marvell International Ltd.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# https://spdx.org/licenses
+#
+
+include plat/marvell/armada/a3700/common/a3700_common.mk
+
+include plat/marvell/armada/common/marvell_common.mk
diff --git a/plat/marvell/a3700/common/a3700_common.mk b/plat/marvell/armada/a3700/common/a3700_common.mk
similarity index 97%
rename from plat/marvell/a3700/common/a3700_common.mk
rename to plat/marvell/armada/a3700/common/a3700_common.mk
index 76c0677..36865a8 100644
--- a/plat/marvell/a3700/common/a3700_common.mk
+++ b/plat/marvell/armada/a3700/common/a3700_common.mk
@@ -5,8 +5,8 @@
# https://spdx.org/licenses
#
-MARVELL_PLAT_BASE := plat/marvell
-MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell
+MARVELL_PLAT_BASE := plat/marvell/armada
+MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell/armada
PLAT_FAMILY := a3700
PLAT_FAMILY_BASE := $(MARVELL_PLAT_BASE)/$(PLAT_FAMILY)
PLAT_INCLUDE_BASE := $(MARVELL_PLAT_INCLUDE_BASE)/$(PLAT_FAMILY)
@@ -15,7 +15,7 @@
MARVELL_COMMON_BASE := $(MARVELL_PLAT_BASE)/common
HANDLE_EA_EL3_FIRST := 1
-include $(MARVELL_PLAT_BASE)/marvell.mk
+include plat/marvell/marvell.mk
#*********** A3700 *************
DOIMAGEPATH := $(WTP)
diff --git a/plat/marvell/a3700/common/a3700_ea.c b/plat/marvell/armada/a3700/common/a3700_ea.c
similarity index 100%
rename from plat/marvell/a3700/common/a3700_ea.c
rename to plat/marvell/armada/a3700/common/a3700_ea.c
diff --git a/plat/marvell/a3700/common/a3700_sip_svc.c b/plat/marvell/armada/a3700/common/a3700_sip_svc.c
similarity index 100%
rename from plat/marvell/a3700/common/a3700_sip_svc.c
rename to plat/marvell/armada/a3700/common/a3700_sip_svc.c
diff --git a/plat/marvell/a3700/common/aarch64/a3700_common.c b/plat/marvell/armada/a3700/common/aarch64/a3700_common.c
similarity index 100%
rename from plat/marvell/a3700/common/aarch64/a3700_common.c
rename to plat/marvell/armada/a3700/common/aarch64/a3700_common.c
diff --git a/plat/marvell/a3700/common/aarch64/plat_helpers.S b/plat/marvell/armada/a3700/common/aarch64/plat_helpers.S
similarity index 100%
rename from plat/marvell/a3700/common/aarch64/plat_helpers.S
rename to plat/marvell/armada/a3700/common/aarch64/plat_helpers.S
diff --git a/plat/marvell/a3700/common/dram_win.c b/plat/marvell/armada/a3700/common/dram_win.c
similarity index 100%
rename from plat/marvell/a3700/common/dram_win.c
rename to plat/marvell/armada/a3700/common/dram_win.c
diff --git a/plat/marvell/a3700/common/include/a3700_plat_def.h b/plat/marvell/armada/a3700/common/include/a3700_plat_def.h
similarity index 100%
rename from plat/marvell/a3700/common/include/a3700_plat_def.h
rename to plat/marvell/armada/a3700/common/include/a3700_plat_def.h
diff --git a/plat/marvell/a3700/common/include/a3700_pm.h b/plat/marvell/armada/a3700/common/include/a3700_pm.h
similarity index 100%
rename from plat/marvell/a3700/common/include/a3700_pm.h
rename to plat/marvell/armada/a3700/common/include/a3700_pm.h
diff --git a/plat/marvell/a3700/common/include/ddr_info.h b/plat/marvell/armada/a3700/common/include/ddr_info.h
similarity index 100%
rename from plat/marvell/a3700/common/include/ddr_info.h
rename to plat/marvell/armada/a3700/common/include/ddr_info.h
diff --git a/plat/marvell/a3700/common/include/dram_win.h b/plat/marvell/armada/a3700/common/include/dram_win.h
similarity index 100%
rename from plat/marvell/a3700/common/include/dram_win.h
rename to plat/marvell/armada/a3700/common/include/dram_win.h
diff --git a/plat/marvell/a3700/common/include/io_addr_dec.h b/plat/marvell/armada/a3700/common/include/io_addr_dec.h
similarity index 100%
rename from plat/marvell/a3700/common/include/io_addr_dec.h
rename to plat/marvell/armada/a3700/common/include/io_addr_dec.h
diff --git a/plat/marvell/a3700/common/include/plat_macros.S b/plat/marvell/armada/a3700/common/include/plat_macros.S
similarity index 100%
rename from plat/marvell/a3700/common/include/plat_macros.S
rename to plat/marvell/armada/a3700/common/include/plat_macros.S
diff --git a/plat/marvell/a3700/common/include/platform_def.h b/plat/marvell/armada/a3700/common/include/platform_def.h
similarity index 100%
rename from plat/marvell/a3700/common/include/platform_def.h
rename to plat/marvell/armada/a3700/common/include/platform_def.h
diff --git a/plat/marvell/a3700/common/io_addr_dec.c b/plat/marvell/armada/a3700/common/io_addr_dec.c
similarity index 100%
rename from plat/marvell/a3700/common/io_addr_dec.c
rename to plat/marvell/armada/a3700/common/io_addr_dec.c
diff --git a/plat/marvell/a3700/common/marvell_plat_config.c b/plat/marvell/armada/a3700/common/marvell_plat_config.c
similarity index 100%
rename from plat/marvell/a3700/common/marvell_plat_config.c
rename to plat/marvell/armada/a3700/common/marvell_plat_config.c
diff --git a/plat/marvell/a3700/common/plat_pm.c b/plat/marvell/armada/a3700/common/plat_pm.c
similarity index 100%
rename from plat/marvell/a3700/common/plat_pm.c
rename to plat/marvell/armada/a3700/common/plat_pm.c
diff --git a/plat/marvell/a8k/a70x0/board/dram_port.c b/plat/marvell/armada/a8k/a70x0/board/dram_port.c
similarity index 100%
rename from plat/marvell/a8k/a70x0/board/dram_port.c
rename to plat/marvell/armada/a8k/a70x0/board/dram_port.c
diff --git a/plat/marvell/a8k/a70x0/board/marvell_plat_config.c b/plat/marvell/armada/a8k/a70x0/board/marvell_plat_config.c
similarity index 100%
rename from plat/marvell/a8k/a70x0/board/marvell_plat_config.c
rename to plat/marvell/armada/a8k/a70x0/board/marvell_plat_config.c
diff --git a/plat/marvell/a8k/a70x0/mvebu_def.h b/plat/marvell/armada/a8k/a70x0/mvebu_def.h
similarity index 100%
rename from plat/marvell/a8k/a70x0/mvebu_def.h
rename to plat/marvell/armada/a8k/a70x0/mvebu_def.h
diff --git a/plat/marvell/a8k/a70x0/platform.mk b/plat/marvell/armada/a8k/a70x0/platform.mk
similarity index 65%
rename from plat/marvell/a8k/a70x0/platform.mk
rename to plat/marvell/armada/a8k/a70x0/platform.mk
index d3a0167..39eb712 100644
--- a/plat/marvell/a8k/a70x0/platform.mk
+++ b/plat/marvell/armada/a8k/a70x0/platform.mk
@@ -14,6 +14,7 @@
MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-include plat/marvell/a8k/common/a8k_common.mk
+BOARD_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+include plat/marvell/armada/a8k/common/a8k_common.mk
-include plat/marvell/common/marvell_common.mk
+include plat/marvell/armada/common/marvell_common.mk
diff --git a/plat/marvell/a8k/a70x0_amc/board/dram_port.c b/plat/marvell/armada/a8k/a70x0_amc/board/dram_port.c
similarity index 100%
rename from plat/marvell/a8k/a70x0_amc/board/dram_port.c
rename to plat/marvell/armada/a8k/a70x0_amc/board/dram_port.c
diff --git a/plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c b/plat/marvell/armada/a8k/a70x0_amc/board/marvell_plat_config.c
similarity index 100%
rename from plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c
rename to plat/marvell/armada/a8k/a70x0_amc/board/marvell_plat_config.c
diff --git a/plat/marvell/a8k/a70x0_amc/mvebu_def.h b/plat/marvell/armada/a8k/a70x0_amc/mvebu_def.h
similarity index 100%
rename from plat/marvell/a8k/a70x0_amc/mvebu_def.h
rename to plat/marvell/armada/a8k/a70x0_amc/mvebu_def.h
diff --git a/plat/marvell/a8k/a70x0/platform.mk b/plat/marvell/armada/a8k/a70x0_amc/platform.mk
similarity index 65%
copy from plat/marvell/a8k/a70x0/platform.mk
copy to plat/marvell/armada/a8k/a70x0_amc/platform.mk
index d3a0167..39eb712 100644
--- a/plat/marvell/a8k/a70x0/platform.mk
+++ b/plat/marvell/armada/a8k/a70x0_amc/platform.mk
@@ -14,6 +14,7 @@
MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-include plat/marvell/a8k/common/a8k_common.mk
+BOARD_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+include plat/marvell/armada/a8k/common/a8k_common.mk
-include plat/marvell/common/marvell_common.mk
+include plat/marvell/armada/common/marvell_common.mk
diff --git a/plat/marvell/a8k/a80x0/board/dram_port.c b/plat/marvell/armada/a8k/a80x0/board/dram_port.c
similarity index 97%
rename from plat/marvell/a8k/a80x0/board/dram_port.c
rename to plat/marvell/armada/a8k/a80x0/board/dram_port.c
index 02f4ffb..017d8a7 100644
--- a/plat/marvell/a8k/a80x0/board/dram_port.c
+++ b/plat/marvell/armada/a8k/a80x0/board/dram_port.c
@@ -52,7 +52,11 @@
MV_DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
+#if DDR32
+ MV_DDR_32BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
+#else
MV_DDR_64BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
+#endif
MV_DDR_CFG_SPD, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0}, /* timing parameters */
diff --git a/plat/marvell/a8k/a80x0/board/marvell_plat_config.c b/plat/marvell/armada/a8k/a80x0/board/marvell_plat_config.c
similarity index 100%
rename from plat/marvell/a8k/a80x0/board/marvell_plat_config.c
rename to plat/marvell/armada/a8k/a80x0/board/marvell_plat_config.c
diff --git a/plat/marvell/a8k/a80x0/board/phy-porting-layer.h b/plat/marvell/armada/a8k/a80x0/board/phy-porting-layer.h
similarity index 100%
rename from plat/marvell/a8k/a80x0/board/phy-porting-layer.h
rename to plat/marvell/armada/a8k/a80x0/board/phy-porting-layer.h
diff --git a/plat/marvell/a8k/a80x0/mvebu_def.h b/plat/marvell/armada/a8k/a80x0/mvebu_def.h
similarity index 100%
rename from plat/marvell/a8k/a80x0/mvebu_def.h
rename to plat/marvell/armada/a8k/a80x0/mvebu_def.h
diff --git a/plat/marvell/a8k/a80x0_mcbin/platform.mk b/plat/marvell/armada/a8k/a80x0/platform.mk
similarity index 65%
rename from plat/marvell/a8k/a80x0_mcbin/platform.mk
rename to plat/marvell/armada/a8k/a80x0/platform.mk
index 3749c37..115dd4a 100644
--- a/plat/marvell/a8k/a80x0_mcbin/platform.mk
+++ b/plat/marvell/armada/a8k/a80x0/platform.mk
@@ -14,6 +14,7 @@
MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-include plat/marvell/a8k/common/a8k_common.mk
+BOARD_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+include plat/marvell/armada/a8k/common/a8k_common.mk
-include plat/marvell/common/marvell_common.mk
+include plat/marvell/armada/common/marvell_common.mk
diff --git a/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c b/plat/marvell/armada/a8k/a80x0_mcbin/board/dram_port.c
similarity index 100%
rename from plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
rename to plat/marvell/armada/a8k/a80x0_mcbin/board/dram_port.c
diff --git a/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c b/plat/marvell/armada/a8k/a80x0_mcbin/board/marvell_plat_config.c
similarity index 100%
rename from plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c
rename to plat/marvell/armada/a8k/a80x0_mcbin/board/marvell_plat_config.c
diff --git a/plat/marvell/a8k/a80x0_mcbin/mvebu_def.h b/plat/marvell/armada/a8k/a80x0_mcbin/mvebu_def.h
similarity index 100%
rename from plat/marvell/a8k/a80x0_mcbin/mvebu_def.h
rename to plat/marvell/armada/a8k/a80x0_mcbin/mvebu_def.h
diff --git a/plat/marvell/a8k/a80x0_mcbin/platform.mk b/plat/marvell/armada/a8k/a80x0_mcbin/platform.mk
similarity index 65%
copy from plat/marvell/a8k/a80x0_mcbin/platform.mk
copy to plat/marvell/armada/a8k/a80x0_mcbin/platform.mk
index 3749c37..115dd4a 100644
--- a/plat/marvell/a8k/a80x0_mcbin/platform.mk
+++ b/plat/marvell/armada/a8k/a80x0_mcbin/platform.mk
@@ -14,6 +14,7 @@
MARVELL_MOCHI_DRV := drivers/marvell/mochi/apn806_setup.c
-include plat/marvell/a8k/common/a8k_common.mk
+BOARD_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+include plat/marvell/armada/a8k/common/a8k_common.mk
-include plat/marvell/common/marvell_common.mk
+include plat/marvell/armada/common/marvell_common.mk
diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/armada/a8k/common/a8k_common.mk
similarity index 88%
rename from plat/marvell/a8k/common/a8k_common.mk
rename to plat/marvell/armada/a8k/common/a8k_common.mk
index 1ff28f8..8731aa6 100644
--- a/plat/marvell/a8k/common/a8k_common.mk
+++ b/plat/marvell/armada/a8k/common/a8k_common.mk
@@ -7,11 +7,10 @@
include tools/marvell/doimage/doimage.mk
PLAT_FAMILY := a8k
-PLAT_FAMILY_BASE := plat/marvell/$(PLAT_FAMILY)
-PLAT_INCLUDE_BASE := include/plat/marvell/$(PLAT_FAMILY)
-PLAT_COMMON_BASE := $(PLAT_FAMILY_BASE)/common
+PLAT_INCLUDE_BASE := include/plat/marvell/armada/$(PLAT_FAMILY)
+PLAT_COMMON_BASE := plat/marvell/armada/a8k/common
MARVELL_DRV_BASE := drivers/marvell
-MARVELL_COMMON_BASE := plat/marvell/common
+MARVELL_COMMON_BASE := plat/marvell/armada/common
MARVELL_SVC_TEST := 0
$(eval $(call add_define,MARVELL_SVC_TEST))
@@ -52,15 +51,15 @@
drivers/arm/gic/v2/gicv2_helpers.c \
plat/common/plat_gicv2.c
-PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
+PLAT_INCLUDES := -I$(BOARD_DIR) \
-I$(PLAT_COMMON_BASE)/include \
-I$(PLAT_INCLUDE_BASE)/common
PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
drivers/ti/uart/aarch64/16550_console.S
-BLE_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/dram_port.c \
- $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
+BLE_PORTING_SOURCES := $(BOARD_DIR)/board/dram_port.c \
+ $(BOARD_DIR)/board/marvell_plat_config.c
MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c
@@ -87,7 +86,7 @@
$(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \
$(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c
-BL31_PORTING_SOURCES := $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
+BL31_PORTING_SOURCES := $(BOARD_DIR)/board/marvell_plat_config.c
ifeq ($(SYSTEM_POWER_SUPPORT),1)
BL31_PORTING_SOURCES += $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c
diff --git a/plat/marvell/a8k/common/aarch64/a8k_common.c b/plat/marvell/armada/a8k/common/aarch64/a8k_common.c
similarity index 100%
rename from plat/marvell/a8k/common/aarch64/a8k_common.c
rename to plat/marvell/armada/a8k/common/aarch64/a8k_common.c
diff --git a/plat/marvell/a8k/common/aarch64/plat_arch_config.c b/plat/marvell/armada/a8k/common/aarch64/plat_arch_config.c
similarity index 72%
rename from plat/marvell/a8k/common/aarch64/plat_arch_config.c
rename to plat/marvell/armada/a8k/common/aarch64/plat_arch_config.c
index 06dc841..9facdbc 100644
--- a/plat/marvell/a8k/common/aarch64/plat_arch_config.c
+++ b/plat/marvell/armada/a8k/common/aarch64/plat_arch_config.c
@@ -13,7 +13,21 @@
#define CCU_HTC_ASET (MVEBU_CCU_BASE(MVEBU_AP0) + 0x264)
#define MVEBU_IO_AFFINITY (0xF00)
+#define MVEBU_SF_REG (MVEBU_REGS_BASE + 0x40)
+#define MVEBU_SF_EN BIT(8)
+#ifdef MVEBU_SOC_AP807
+static void plat_enable_snoop_filter(void)
+{
+ int cpu_id = plat_my_core_pos();
+
+ /* Snoop filter needs to be enabled once per cluster */
+ if (cpu_id % 2)
+ return;
+
+ mmio_setbits_32(MVEBU_SF_REG, MVEBU_SF_EN);
+}
+#endif
static void plat_enable_affinity(void)
{
@@ -42,4 +56,8 @@
/* Enable Affinity */
plat_enable_affinity();
+
+#ifdef MVEBU_SOC_AP807
+ plat_enable_snoop_filter();
+#endif
}
diff --git a/plat/marvell/a8k/common/aarch64/plat_helpers.S b/plat/marvell/armada/a8k/common/aarch64/plat_helpers.S
similarity index 100%
rename from plat/marvell/a8k/common/aarch64/plat_helpers.S
rename to plat/marvell/armada/a8k/common/aarch64/plat_helpers.S
diff --git a/plat/marvell/a8k/common/ble/ble.ld.S b/plat/marvell/armada/a8k/common/ble/ble.ld.S
similarity index 100%
rename from plat/marvell/a8k/common/ble/ble.ld.S
rename to plat/marvell/armada/a8k/common/ble/ble.ld.S
diff --git a/plat/marvell/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
similarity index 96%
rename from plat/marvell/a8k/common/ble/ble.mk
rename to plat/marvell/armada/a8k/common/ble/ble.mk
index b6a9cd2..82ac098 100644
--- a/plat/marvell/a8k/common/ble/ble.mk
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
@@ -8,7 +8,7 @@
MV_DDR_LIB = $(CURDIR)/$(BUILD_PLAT)/ble/mv_ddr_lib.a
LIBC_LIB = $(CURDIR)/$(BUILD_PLAT)/lib/libc.a
BLE_LIBS = $(MV_DDR_LIB) $(LIBC_LIB)
-PLAT_MARVELL = plat/marvell
+PLAT_MARVELL = plat/marvell/armada
BLE_SOURCES += $(BLE_PATH)/ble_main.c \
$(BLE_PATH)/ble_mem.S \
diff --git a/plat/marvell/a8k/common/ble/ble_main.c b/plat/marvell/armada/a8k/common/ble/ble_main.c
similarity index 100%
rename from plat/marvell/a8k/common/ble/ble_main.c
rename to plat/marvell/armada/a8k/common/ble/ble_main.c
diff --git a/plat/marvell/a8k/common/ble/ble_mem.S b/plat/marvell/armada/a8k/common/ble/ble_mem.S
similarity index 100%
rename from plat/marvell/a8k/common/ble/ble_mem.S
rename to plat/marvell/armada/a8k/common/ble/ble_mem.S
diff --git a/plat/marvell/a8k/common/include/a8k_plat_def.h b/plat/marvell/armada/a8k/common/include/a8k_plat_def.h
similarity index 100%
rename from plat/marvell/a8k/common/include/a8k_plat_def.h
rename to plat/marvell/armada/a8k/common/include/a8k_plat_def.h
diff --git a/plat/marvell/a8k/common/include/ddr_info.h b/plat/marvell/armada/a8k/common/include/ddr_info.h
similarity index 100%
rename from plat/marvell/a8k/common/include/ddr_info.h
rename to plat/marvell/armada/a8k/common/include/ddr_info.h
diff --git a/plat/marvell/a8k/common/include/mentor_i2c_plat.h b/plat/marvell/armada/a8k/common/include/mentor_i2c_plat.h
similarity index 100%
rename from plat/marvell/a8k/common/include/mentor_i2c_plat.h
rename to plat/marvell/armada/a8k/common/include/mentor_i2c_plat.h
diff --git a/plat/marvell/a8k/common/include/plat_macros.S b/plat/marvell/armada/a8k/common/include/plat_macros.S
similarity index 100%
rename from plat/marvell/a8k/common/include/plat_macros.S
rename to plat/marvell/armada/a8k/common/include/plat_macros.S
diff --git a/plat/marvell/a8k/common/include/platform_def.h b/plat/marvell/armada/a8k/common/include/platform_def.h
similarity index 100%
rename from plat/marvell/a8k/common/include/platform_def.h
rename to plat/marvell/armada/a8k/common/include/platform_def.h
diff --git a/plat/marvell/a8k/common/mss/mss_a8k.mk b/plat/marvell/armada/a8k/common/mss/mss_a8k.mk
similarity index 92%
rename from plat/marvell/a8k/common/mss/mss_a8k.mk
rename to plat/marvell/armada/a8k/common/mss/mss_a8k.mk
index efd03c5..d8d4921 100644
--- a/plat/marvell/a8k/common/mss/mss_a8k.mk
+++ b/plat/marvell/armada/a8k/common/mss/mss_a8k.mk
@@ -5,7 +5,7 @@
# https://spdx.org/licenses
#
-PLAT_MARVELL := plat/marvell
+PLAT_MARVELL := plat/marvell/armada
A8K_MSS_SOURCE := $(PLAT_MARVELL)/a8k/common/mss
BL2_SOURCES += $(A8K_MSS_SOURCE)/mss_bl2_setup.c \
diff --git a/plat/marvell/a8k/common/mss/mss_bl2_setup.c b/plat/marvell/armada/a8k/common/mss/mss_bl2_setup.c
similarity index 100%
rename from plat/marvell/a8k/common/mss/mss_bl2_setup.c
rename to plat/marvell/armada/a8k/common/mss/mss_bl2_setup.c
diff --git a/plat/marvell/a8k/common/mss/mss_pm_ipc.c b/plat/marvell/armada/a8k/common/mss/mss_pm_ipc.c
similarity index 100%
rename from plat/marvell/a8k/common/mss/mss_pm_ipc.c
rename to plat/marvell/armada/a8k/common/mss/mss_pm_ipc.c
diff --git a/plat/marvell/a8k/common/mss/mss_pm_ipc.h b/plat/marvell/armada/a8k/common/mss/mss_pm_ipc.h
similarity index 100%
rename from plat/marvell/a8k/common/mss/mss_pm_ipc.h
rename to plat/marvell/armada/a8k/common/mss/mss_pm_ipc.h
diff --git a/plat/marvell/a8k/common/plat_bl1_setup.c b/plat/marvell/armada/a8k/common/plat_bl1_setup.c
similarity index 100%
rename from plat/marvell/a8k/common/plat_bl1_setup.c
rename to plat/marvell/armada/a8k/common/plat_bl1_setup.c
diff --git a/plat/marvell/a8k/common/plat_bl31_setup.c b/plat/marvell/armada/a8k/common/plat_bl31_setup.c
similarity index 92%
rename from plat/marvell/a8k/common/plat_bl31_setup.c
rename to plat/marvell/armada/a8k/common/plat_bl31_setup.c
index 98b3966..621f43c 100644
--- a/plat/marvell/a8k/common/plat_bl31_setup.c
+++ b/plat/marvell/armada/a8k/common/plat_bl31_setup.c
@@ -116,18 +116,24 @@
marvell_bl31_plat_arch_setup();
for (cp = 0; cp < CP_COUNT; cp++) {
- /* configure cp110 for CP0*/
- if (cp == 1)
- mci_initialize(MVEBU_MCI0);
+ if (cp >= 1)
+ update_cp110_default_win(cp);
- /* initialize MCI & CP1 */
cp110_init(MVEBU_CP_REGS_BASE(cp),
STREAM_ID_BASE + (cp * MAX_STREAM_ID_PER_CP));
- /* Should be called only after setting IOB windows */
marvell_bl31_mpp_init(cp);
}
+ /*
+ * There is need to configure IO_WIN windows again to overwrite
+ * temporary configuration done during update_cp110_default_win
+ */
+ init_io_win(MVEBU_AP0);
+
+ for (cp = 1; cp < CP_COUNT; cp++)
+ mci_link_tune(cp - 1);
+
/* initialize IPC between MSS and ATF */
if (mailbox[MBOX_IDX_MAGIC] != MVEBU_MAILBOX_MAGIC_NUM ||
mailbox[MBOX_IDX_SUSPEND_MAGIC] != MVEBU_MAILBOX_SUSPEND_STATE)
diff --git a/plat/marvell/a8k/common/plat_ble_setup.c b/plat/marvell/armada/a8k/common/plat_ble_setup.c
similarity index 98%
rename from plat/marvell/a8k/common/plat_ble_setup.c
rename to plat/marvell/armada/a8k/common/plat_ble_setup.c
index 7f9e242..f11b5ac 100644
--- a/plat/marvell/a8k/common/plat_ble_setup.c
+++ b/plat/marvell/armada/a8k/common/plat_ble_setup.c
@@ -89,6 +89,12 @@
(0x1 << AVS_SOFT_RESET_OFFSET) | \
(0x1 << AVS_ENABLE_OFFSET))
+#define AVS_CN9130_HIGH_CLK_VALUE ((0x80 << 24) | \
+ (0x2dc << 13) | \
+ (0x2dc << 3) | \
+ (0x1 << AVS_SOFT_RESET_OFFSET) | \
+ (0x1 << AVS_ENABLE_OFFSET))
+
#define MVEBU_AP_EFUSE_SRV_CTRL_REG (MVEBU_AP_GEN_MGMT_BASE + 0x8)
#define EFUSE_SRV_CTRL_LD_SELECT_OFFS 6
#define EFUSE_SRV_CTRL_LD_SEL_USER_MASK (1 << EFUSE_SRV_CTRL_LD_SELECT_OFFS)
@@ -224,10 +230,19 @@
/* Check which SoC is running and act accordingly */
if (ble_get_ap_type() == CHIP_ID_AP807) {
/* Increase CPU voltage for higher CPU clock */
- if (freq_mode == CPU_2000_DDR_1200_RCLK_1200)
+ switch (freq_mode) {
+ case CPU_2000_DDR_1200_RCLK_1200:
avs_val = AVS_A3900_HIGH_CLK_VALUE;
- else
+ break;
+#ifdef MVEBU_SOC_AP807
+ case CPU_2200_DDR_1200_RCLK_1200:
+ avs_val = AVS_CN9130_HIGH_CLK_VALUE;
+ break;
+#endif
+ default:
avs_val = AVS_A3900_CLK_VALUE;
+ }
+
} else {
/* Check which SoC is running and act accordingly */
device_id = cp110_device_id_get(MVEBU_CP_REGS_BASE(0));
@@ -463,7 +478,6 @@
NOTICE("SVC: DEV ID: %s, FREQ Mode: 0x%x\n",
single_cluster == 0 ? "8040" : "8020", freq_pidi_mode);
switch (freq_pidi_mode) {
- case CPU_1800_DDR_1200_RCLK_1200:
case CPU_1800_DDR_1050_RCLK_1050:
if (perr[1])
goto perror;
diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/armada/a8k/common/plat_pm.c
similarity index 100%
rename from plat/marvell/a8k/common/plat_pm.c
rename to plat/marvell/armada/a8k/common/plat_pm.c
diff --git a/plat/marvell/a8k/common/plat_pm_trace.c b/plat/marvell/armada/a8k/common/plat_pm_trace.c
similarity index 100%
rename from plat/marvell/a8k/common/plat_pm_trace.c
rename to plat/marvell/armada/a8k/common/plat_pm_trace.c
diff --git a/plat/marvell/a8k/common/plat_thermal.c b/plat/marvell/armada/a8k/common/plat_thermal.c
similarity index 100%
rename from plat/marvell/a8k/common/plat_thermal.c
rename to plat/marvell/armada/a8k/common/plat_thermal.c
diff --git a/plat/marvell/common/aarch64/marvell_bl2_mem_params_desc.c b/plat/marvell/armada/common/aarch64/marvell_bl2_mem_params_desc.c
similarity index 100%
rename from plat/marvell/common/aarch64/marvell_bl2_mem_params_desc.c
rename to plat/marvell/armada/common/aarch64/marvell_bl2_mem_params_desc.c
diff --git a/plat/marvell/common/aarch64/marvell_common.c b/plat/marvell/armada/common/aarch64/marvell_common.c
similarity index 100%
rename from plat/marvell/common/aarch64/marvell_common.c
rename to plat/marvell/armada/common/aarch64/marvell_common.c
diff --git a/plat/marvell/common/aarch64/marvell_helpers.S b/plat/marvell/armada/common/aarch64/marvell_helpers.S
similarity index 100%
rename from plat/marvell/common/aarch64/marvell_helpers.S
rename to plat/marvell/armada/common/aarch64/marvell_helpers.S
diff --git a/plat/marvell/common/marvell_bl1_setup.c b/plat/marvell/armada/common/marvell_bl1_setup.c
similarity index 100%
rename from plat/marvell/common/marvell_bl1_setup.c
rename to plat/marvell/armada/common/marvell_bl1_setup.c
diff --git a/plat/marvell/common/marvell_bl2_setup.c b/plat/marvell/armada/common/marvell_bl2_setup.c
similarity index 100%
rename from plat/marvell/common/marvell_bl2_setup.c
rename to plat/marvell/armada/common/marvell_bl2_setup.c
diff --git a/plat/marvell/common/marvell_bl31_setup.c b/plat/marvell/armada/common/marvell_bl31_setup.c
similarity index 100%
rename from plat/marvell/common/marvell_bl31_setup.c
rename to plat/marvell/armada/common/marvell_bl31_setup.c
diff --git a/plat/marvell/common/marvell_cci.c b/plat/marvell/armada/common/marvell_cci.c
similarity index 100%
rename from plat/marvell/common/marvell_cci.c
rename to plat/marvell/armada/common/marvell_cci.c
diff --git a/plat/marvell/common/marvell_common.mk b/plat/marvell/armada/common/marvell_common.mk
similarity index 92%
rename from plat/marvell/common/marvell_common.mk
rename to plat/marvell/armada/common/marvell_common.mk
index f41d7a4..f5f0c41 100644
--- a/plat/marvell/common/marvell_common.mk
+++ b/plat/marvell/armada/common/marvell_common.mk
@@ -3,11 +3,11 @@
# SPDX-License-Identifier: BSD-3-Clause
# https://spdx.org/licenses
-MARVELL_PLAT_BASE := plat/marvell
-MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell
+MARVELL_PLAT_BASE := plat/marvell/armada
+MARVELL_PLAT_INCLUDE_BASE := include/plat/marvell/armada
-include $(MARVELL_PLAT_BASE)/version.mk
-include $(MARVELL_PLAT_BASE)/marvell.mk
+include plat/marvell/version.mk
+include plat/marvell/marvell.mk
VERSION_STRING +=(Marvell-${SUBVERSION})
diff --git a/plat/marvell/common/marvell_console.c b/plat/marvell/armada/common/marvell_console.c
similarity index 100%
rename from plat/marvell/common/marvell_console.c
rename to plat/marvell/armada/common/marvell_console.c
diff --git a/plat/marvell/common/marvell_ddr_info.c b/plat/marvell/armada/common/marvell_ddr_info.c
similarity index 100%
rename from plat/marvell/common/marvell_ddr_info.c
rename to plat/marvell/armada/common/marvell_ddr_info.c
diff --git a/plat/marvell/common/marvell_gicv2.c b/plat/marvell/armada/common/marvell_gicv2.c
similarity index 100%
rename from plat/marvell/common/marvell_gicv2.c
rename to plat/marvell/armada/common/marvell_gicv2.c
diff --git a/plat/marvell/common/marvell_gicv3.c b/plat/marvell/armada/common/marvell_gicv3.c
similarity index 100%
rename from plat/marvell/common/marvell_gicv3.c
rename to plat/marvell/armada/common/marvell_gicv3.c
diff --git a/plat/marvell/common/marvell_image_load.c b/plat/marvell/armada/common/marvell_image_load.c
similarity index 100%
rename from plat/marvell/common/marvell_image_load.c
rename to plat/marvell/armada/common/marvell_image_load.c
diff --git a/plat/marvell/common/marvell_io_storage.c b/plat/marvell/armada/common/marvell_io_storage.c
similarity index 100%
rename from plat/marvell/common/marvell_io_storage.c
rename to plat/marvell/armada/common/marvell_io_storage.c
diff --git a/plat/marvell/common/marvell_pm.c b/plat/marvell/armada/common/marvell_pm.c
similarity index 100%
rename from plat/marvell/common/marvell_pm.c
rename to plat/marvell/armada/common/marvell_pm.c
diff --git a/plat/marvell/common/marvell_topology.c b/plat/marvell/armada/common/marvell_topology.c
similarity index 100%
rename from plat/marvell/common/marvell_topology.c
rename to plat/marvell/armada/common/marvell_topology.c
diff --git a/plat/marvell/common/mrvl_sip_svc.c b/plat/marvell/armada/common/mrvl_sip_svc.c
similarity index 100%
rename from plat/marvell/common/mrvl_sip_svc.c
rename to plat/marvell/armada/common/mrvl_sip_svc.c
diff --git a/plat/marvell/common/mss/mss_common.mk b/plat/marvell/armada/common/mss/mss_common.mk
similarity index 82%
rename from plat/marvell/common/mss/mss_common.mk
rename to plat/marvell/armada/common/mss/mss_common.mk
index 898b6dc..4ab4359 100644
--- a/plat/marvell/common/mss/mss_common.mk
+++ b/plat/marvell/armada/common/mss/mss_common.mk
@@ -6,14 +6,14 @@
#
-PLAT_MARVELL := plat/marvell
+PLAT_MARVELL := plat/marvell/armada
MSS_SOURCE := $(PLAT_MARVELL)/common/mss
BL2_SOURCES += $(MSS_SOURCE)/mss_scp_bootloader.c \
$(PLAT_MARVELL)/common/plat_delay_timer.c \
drivers/delay_timer/delay_timer.c \
$(MARVELL_DRV) \
- $(PLAT_FAMILY_BASE)/$(PLAT)/board/marvell_plat_config.c
+ $(BOARD_DIR)/board/marvell_plat_config.c
BL31_SOURCES += $(MSS_SOURCE)/mss_ipc_drv.c
diff --git a/plat/marvell/common/mss/mss_ipc_drv.c b/plat/marvell/armada/common/mss/mss_ipc_drv.c
similarity index 100%
rename from plat/marvell/common/mss/mss_ipc_drv.c
rename to plat/marvell/armada/common/mss/mss_ipc_drv.c
diff --git a/plat/marvell/common/mss/mss_ipc_drv.h b/plat/marvell/armada/common/mss/mss_ipc_drv.h
similarity index 100%
rename from plat/marvell/common/mss/mss_ipc_drv.h
rename to plat/marvell/armada/common/mss/mss_ipc_drv.h
diff --git a/plat/marvell/common/mss/mss_mem.h b/plat/marvell/armada/common/mss/mss_mem.h
similarity index 100%
rename from plat/marvell/common/mss/mss_mem.h
rename to plat/marvell/armada/common/mss/mss_mem.h
diff --git a/plat/marvell/common/mss/mss_scp_bl2_format.h b/plat/marvell/armada/common/mss/mss_scp_bl2_format.h
similarity index 100%
rename from plat/marvell/common/mss/mss_scp_bl2_format.h
rename to plat/marvell/armada/common/mss/mss_scp_bl2_format.h
diff --git a/plat/marvell/common/mss/mss_scp_bootloader.c b/plat/marvell/armada/common/mss/mss_scp_bootloader.c
similarity index 100%
rename from plat/marvell/common/mss/mss_scp_bootloader.c
rename to plat/marvell/armada/common/mss/mss_scp_bootloader.c
diff --git a/plat/marvell/common/mss/mss_scp_bootloader.h b/plat/marvell/armada/common/mss/mss_scp_bootloader.h
similarity index 100%
rename from plat/marvell/common/mss/mss_scp_bootloader.h
rename to plat/marvell/armada/common/mss/mss_scp_bootloader.h
diff --git a/plat/marvell/common/plat_delay_timer.c b/plat/marvell/armada/common/plat_delay_timer.c
similarity index 100%
rename from plat/marvell/common/plat_delay_timer.c
rename to plat/marvell/armada/common/plat_delay_timer.c
diff --git a/plat/marvell/marvell.mk b/plat/marvell/marvell.mk
index d8be0dd..8245753 100644
--- a/plat/marvell/marvell.mk
+++ b/plat/marvell/marvell.mk
@@ -16,6 +16,10 @@
PALLADIUM := 0
$(eval $(call add_define,PALLADIUM))
+# Set board to work with DDR 32bit
+DDR32 := 0
+$(eval $(call add_define,DDR32))
+
ifeq (${MARVELL_SECURE_BOOT},1)
DOIMAGE_SEC_FLAGS := -c $(DOIMAGE_SEC)
DOIMAGE_LIBS_CHECK = \