Commit f97441f4 authored by Hou Zhiqiang's avatar Hou Zhiqiang Committed by Lorenzo Pieralisi

PCI: mobiveil: Refactor the MEM/IO outbound window initialization

Move the resource type check into an if/else block and only
set-up the outbound window for MEM and IO resource. No functional
change intended.
Signed-off-by: default avatarHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarMinghuan Lian <Minghuan.Lian@nxp.com>
parent 91347af1
...@@ -565,7 +565,7 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) ...@@ -565,7 +565,7 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie)
static int mobiveil_host_init(struct mobiveil_pcie *pcie) static int mobiveil_host_init(struct mobiveil_pcie *pcie)
{ {
u32 value, pab_ctrl, type = 0; u32 value, pab_ctrl, type;
struct resource_entry *win; struct resource_entry *win;
/* setup bus numbers */ /* setup bus numbers */
...@@ -617,18 +617,18 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) ...@@ -617,18 +617,18 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie)
/* Get the I/O and memory ranges from DT */ /* Get the I/O and memory ranges from DT */
resource_list_for_each_entry(win, &pcie->resources) { resource_list_for_each_entry(win, &pcie->resources) {
type = 0;
if (resource_type(win->res) == IORESOURCE_MEM) if (resource_type(win->res) == IORESOURCE_MEM)
type = MEM_WINDOW_TYPE; type = MEM_WINDOW_TYPE;
if (resource_type(win->res) == IORESOURCE_IO) else if (resource_type(win->res) == IORESOURCE_IO)
type = IO_WINDOW_TYPE; type = IO_WINDOW_TYPE;
if (type) { else
/* configure outbound translation window */ continue;
program_ob_windows(pcie, pcie->ob_wins_configured,
win->res->start, /* configure outbound translation window */
win->res->start - win->offset, program_ob_windows(pcie, pcie->ob_wins_configured,
type, resource_size(win->res)); win->res->start,
} win->res->start - win->offset,
type, resource_size(win->res));
} }
/* fixup for PCIe class register */ /* fixup for PCIe class register */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment