summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKonstantin Porotchkin <kostap@marvell.com>2018-01-17 18:50:59 +0200
committerKostya Porotchkin <kostap@marvell.com>2018-01-18 11:03:56 +0200
commit7661742fcd2f898fd003ed5d3fb1088315fe6774 (patch)
tree87e83ee653726f224d9c79393dbf0aa78c6c69d0 /drivers
parent683605c2bad5f06958f0b84c8930862829849901 (diff)
fix: mvebu: gwin: Fix the window base address alinment
In GWIN window the unaligned address should be aligned down and not up Larger address cannot be covered with the requested window size. Change-Id: If4790a5094025910186175956dce7d89e59cb8d9 Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/49180 Reviewed-by: Hanna Hawa <hannah@marvell.com> Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Igal Liberman <igall@marvell.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/marvell/gwin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/marvell/gwin.c b/drivers/marvell/gwin.c
index 5acb547c..2b673b6e 100644
--- a/drivers/marvell/gwin.c
+++ b/drivers/marvell/gwin.c
@@ -68,8 +68,8 @@ static void gwin_check(struct addr_map_win *win)
{
/* The base is always 64M aligned */
if (IS_NOT_ALIGN(win->base_addr, GWIN_ALIGNMENT_64M)) {
- win->base_addr = ALIGN_UP(win->base_addr, GWIN_ALIGNMENT_64M);
- NOTICE("%s: Align up the base address to 0x%lx\n", __func__, win->base_addr);
+ win->base_addr &= ~(GWIN_ALIGNMENT_64M - 1);
+ NOTICE("%s: Align the base address to 0x%lx\n", __func__, win->base_addr);
}
/* size parameter validity check */