summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHanna Hawa <hannah@marvell.com>2017-08-17 16:53:53 +0300
committerKostya Porotchkin <kostap@marvell.com>2017-08-21 14:54:46 +0300
commitbaf0f468a356344a294409f22b74f0e5afca62a3 (patch)
tree0584b8c0d49a0bd3107d087413cb90763399d3f2 /drivers
parent39f74f1f2bf89a4cff8d8d192aca30bdac1a628f (diff)
fix: ap806: io-win: change the name of RFU window to be IO-WIN
The name of RFU used in old AP806-Z SoC. This patch update the used name to be IO-WIN, the correct unit name in AP806-Ax, and AP810-A0 Change-Id: I9fc12e25c34aa97aa09a7b9b21837e71092058d9 Signed-off-by: Hanna Hawa <hannah@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/43184 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/marvell/io_win.c (renamed from drivers/marvell/rfu.c)96
-rw-r--r--drivers/marvell/mochi/apn806_setup.c6
2 files changed, 50 insertions, 52 deletions
diff --git a/drivers/marvell/rfu.c b/drivers/marvell/io_win.c
index 39b37395..f0551312 100644
--- a/drivers/marvell/rfu.c
+++ b/drivers/marvell/io_win.c
@@ -36,7 +36,7 @@
#include <debug.h>
#include <mmio.h>
#include <mvebu.h>
-#include <rfu.h>
+#include <io_win.h>
#include <plat_config.h>
#if LOG_LEVEL >= LOG_LEVEL_INFO
@@ -48,30 +48,28 @@
/* Physical address of the base of the window = {Addr[19:0],20`h0} */
#define ADDRESS_SHIFT (20 - 4)
#define ADDRESS_MASK (0xFFFFFFF0)
-#define RFU_WIN_ALIGNMENT_1M (0x100000)
-#define RFU_WIN_ALIGNMENT_64K (0x10000)
+#define IO_WIN_ALIGNMENT_1M (0x100000)
+#define IO_WIN_ALIGNMENT_64K (0x10000)
/* AP registers */
-#define RFU_WIN_ALR_OFFSET(win) (rfu_base + 0x0 + (0x10 * win))
-#define RFU_WIN_AHR_OFFSET(win) (rfu_base + 0x8 + (0x10 * win))
-#define RFU_WIN_CR_OFFSET(win) (rfu_base + 0xC + (0x10 * win))
-#define RFU_GCR_OFFSET (rfu_base + 0x70)
+#define IO_WIN_ALR_OFFSET(win) (io_win_base + 0x0 + (0x10 * win))
+#define IO_WIN_AHR_OFFSET(win) (io_win_base + 0x8 + (0x10 * win))
+#define IO_WIN_CR_OFFSET(win) (io_win_base + 0xC + (0x10 * win))
+#define IO_WIN_GCR_OFFSET (io_win_base + 0x70)
+uintptr_t io_win_base;
-uintptr_t rfu_base;
-
-
-static void rfu_win_check(struct rfu_win *win, uint32_t win_num)
+static void io_win_check(struct io_win *win, uint32_t win_num)
{
uint64_t base_addr, win_size;
- uint32_t alignment_value = RFU_WIN_ALIGNMENT_1M;
+ uint32_t alignment_value = IO_WIN_ALIGNMENT_1M;
- /* for RFU The base is always 1M aligned */
+ /* for IO The base is always 1M aligned */
/* check if address is aligned to 1M */
base_addr = ((uint64_t)win->base_addr_high << 32) + win->base_addr_low;
- if (IS_NOT_ALIGN(base_addr, RFU_WIN_ALIGNMENT_1M)) {
- base_addr = ALIGN_UP(base_addr, RFU_WIN_ALIGNMENT_1M);
- ERROR("Window %d: base address unaligned to 0x%x\n", win_num, RFU_WIN_ALIGNMENT_1M);
+ if (IS_NOT_ALIGN(base_addr, IO_WIN_ALIGNMENT_1M)) {
+ base_addr = ALIGN_UP(base_addr, IO_WIN_ALIGNMENT_1M);
+ ERROR("Window %d: base address unaligned to 0x%x\n", win_num, IO_WIN_ALIGNMENT_1M);
printf("Align up the base address to 0x%lx\n", base_addr);
win->base_addr_high = (uint32_t)(base_addr >> 32);
win->base_addr_low = (uint32_t)(base_addr);
@@ -88,12 +86,12 @@ static void rfu_win_check(struct rfu_win *win, uint32_t win_num)
}
}
-static void rfu_enable_win(struct rfu_win *win, uint32_t win_num)
+static void io_win_enable_window(struct io_win *win, uint32_t win_num)
{
uint32_t alr, ahr;
uint64_t start_addr, end_addr;
- if (win->target_id < 0 || win->target_id >= RFU_MAX_WIN_ID) {
+ if (win->target_id < 0 || win->target_id >= IO_WIN_MAX_NUM) {
ERROR("target ID = %d, is invalid\n", win->target_id);
return;
}
@@ -106,28 +104,28 @@ static void rfu_enable_win(struct rfu_win *win, uint32_t win_num)
alr |= WIN_ENABLE_BIT;
ahr = (uint32_t)((end_addr >> ADDRESS_SHIFT) & ADDRESS_MASK);
- /* write start address and end address for rfu window */
- mmio_write_32(RFU_WIN_ALR_OFFSET(win_num), alr);
- mmio_write_32(RFU_WIN_AHR_OFFSET(win_num), ahr);
+ /* write start address and end address for IO window */
+ mmio_write_32(IO_WIN_ALR_OFFSET(win_num), alr);
+ mmio_write_32(IO_WIN_AHR_OFFSET(win_num), ahr);
/* write window target */
- mmio_write_32(RFU_WIN_CR_OFFSET(win_num), win->target_id);
+ mmio_write_32(IO_WIN_CR_OFFSET(win_num), win->target_id);
}
#ifdef DEBUG_ADDR_MAP
-static void dump_rfu(void)
+static void dump_io(void)
{
uint32_t trgt_id, win_id;
uint32_t alr, ahr;
uint64_t start, end;
- char *rfu_target_name[RFU_MAX_TID] = {"MCI-0 ", "MCI-1 ", "MCI-2 ", "PIDI ",
+ char *io_win_target_name[IO_WIN_MAX_TID] = {"MCI-0 ", "MCI-1 ", "MCI-2 ", "PIDI ",
"SPI ", "STM ", "BootRoom "};
- /* Dump all RFU windows */
+ /* Dump all IO windows */
printf("bank target start end\n");
printf("----------------------------------------------------\n");
- for (win_id = 0; win_id < RFU_MAX_WIN_ID; win_id++) {
- alr = mmio_read_32(RFU_WIN_ALR_OFFSET(win_id));
+ for (win_id = 0; win_id < IO_WIN_MAX_NUM; win_id++) {
+ alr = mmio_read_32(IO_WIN_ALR_OFFSET(win_id));
if (alr & WIN_ENABLE_BIT) {
alr &= ~WIN_ENABLE_BIT;
/* in case this is BOOTROM window */
@@ -135,63 +133,63 @@ static void dump_rfu(void)
ahr = alr;
trgt_id = BOOTROM_TID;
} else {
- ahr = mmio_read_32(RFU_WIN_AHR_OFFSET(win_id));
- trgt_id = mmio_read_32(RFU_WIN_CR_OFFSET(win_id));
+ ahr = mmio_read_32(IO_WIN_AHR_OFFSET(win_id));
+ trgt_id = mmio_read_32(IO_WIN_CR_OFFSET(win_id));
}
start = ((uint64_t)alr << ADDRESS_SHIFT);
end = (((uint64_t)ahr + 0x10) << ADDRESS_SHIFT);
- printf("rfu %s 0x%016lx 0x%016lx\n", rfu_target_name[trgt_id], start, end);
+ printf("io-win %s 0x%016lx 0x%016lx\n", io_win_target_name[trgt_id], start, end);
}
}
- printf("rfu PIDI-port - all other IO transactions\n");
+ printf("io-win PIDI-port - all other IO transactions\n");
return;
}
#endif
-int init_rfu(void)
+int init_io_win(void)
{
- struct rfu_win *win;
+ struct io_win *win;
uint32_t win_id, win_reg;
uint32_t win_count;
- INFO("Initializing RFU Address decoding\n");
+ INFO("Initializing IO WIN Address decoding\n");
/* Get the base address of the address decoding MBUS */
- rfu_base = marvell_get_rfu_reg_offs();
+ io_win_base = marvell_get_io_win_reg_offs();
/* Get the array of the windows and its size */
- marvell_get_rfu_memory_map(&win, &win_count);
- if (win_count <= 0) {
+ marvell_get_io_win_memory_map(&win, &win_count);
+ if (win_count <= 0)
INFO("no windows configurations found\n");
- }
- if (win_count > RFU_MAX_WIN_ID) {
- INFO("number of windows is bigger than %d\n", RFU_MAX_WIN_ID);
+
+ if (win_count > IO_WIN_MAX_NUM) {
+ INFO("number of windows is bigger than %d\n", IO_WIN_MAX_NUM);
return 0;
}
/* set the default target id to PIDI */
win_reg = PIDI_TID;
- mmio_write_32(RFU_GCR_OFFSET, win_reg);
+ mmio_write_32(IO_WIN_GCR_OFFSET, win_reg);
- /* disable all RFU windows */
- for (win_id = 0; win_id < RFU_MAX_WIN_ID; win_id++) {
- win_reg = mmio_read_32(RFU_WIN_ALR_OFFSET(win_id));
+ /* disable all IO windows */
+ for (win_id = 0; win_id < IO_WIN_MAX_NUM; win_id++) {
+ win_reg = mmio_read_32(IO_WIN_ALR_OFFSET(win_id));
win_reg &= ~WIN_ENABLE_BIT;
- mmio_write_32(RFU_WIN_ALR_OFFSET(win_id), win_reg);
+ mmio_write_32(IO_WIN_ALR_OFFSET(win_id), win_reg);
}
/* enable relevant windows, starting from win_id=1 because index 0 dedicated for BootRom */
for (win_id = 1; win_id <= win_count; win_id++, win++) {
- rfu_win_check(win, win_id);
- rfu_enable_win(win, win_id);
+ io_win_check(win, win_id);
+ io_win_enable_window(win, win_id);
}
#ifdef DEBUG_ADDR_MAP
- dump_rfu();
+ dump_io_win();
#endif
- INFO("Done RFU Address decoding Initializing\n");
+ INFO("Done IO WIN Address decoding Initializing\n");
return 0;
}
diff --git a/drivers/marvell/mochi/apn806_setup.c b/drivers/marvell/mochi/apn806_setup.c
index fb2f4e4b..de18cbb7 100644
--- a/drivers/marvell/mochi/apn806_setup.c
+++ b/drivers/marvell/mochi/apn806_setup.c
@@ -34,7 +34,7 @@
#include <plat_def.h>
#include <apn806_setup.h>
-#include <rfu.h>
+#include <io_win.h>
#include <ccu.h>
#include <mci.h>
#include <cache_llc.h>
@@ -213,8 +213,8 @@ void apn806_init(void)
/* configure MCI mapping */
mci_remap_indirect_access_base();
- /* configure RFU windows */
- init_rfu();
+ /* configure IO_WIN windows */
+ init_io_win();
/* configure CCU windows */
init_ccu();