Skip to content

Commit 5e47986

Browse files
author
Guodong Xu
committed
Merge pull request torvalds#169 from 96boards/revert-pull-request-163
Revert "Quick fix so that driver retrieves addresses from device tree…
2 parents c392c35 + 7f937d8 commit 5e47986

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

drivers/clk/hisilicon/clk-hi6220.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ static struct hisi_gate_clock hi6220_separated_gate_clks_ao[] __initdata = {
7474
{ HI6220_RTC1_PCLK, "rtc1_pclk", "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 26, 0, },
7575
};
7676

77+
#define SOC_PERI_SCTRL_BASE_ADDR 0xF7030000 /* peri ctrl base addr */
7778
#define SC_PERIPH_CTRL14 0x02C
7879
#define SC_PERIPH_STAT1 0x094
80+
#define SOC_PMCTRL_BASE_ADDR 0xF7032000 /* pm ctrl base addr*/
7981
#define SC_PM_DDRPLL_STAT 0x18
8082
#define SC_PM_SYSPLL_STAT 0x28
8183
#define SC_PM_MEDPLL_STAT 0x38
@@ -84,8 +86,6 @@ static struct hisi_clock_data *clk_data_ao;
8486

8587
static void __init hi6220_clk_ao_init(struct device_node *np)
8688
{
87-
struct device_node *peri_node, *pm_node;
88-
struct resource res;
8989
void __iomem *peri_base, *pm_base;
9090
unsigned int freq_u, freq_l, freq, pll_stat;
9191
int i;
@@ -94,22 +94,8 @@ static void __init hi6220_clk_ao_init(struct device_node *np)
9494
if (!clk_data_ao)
9595
return;
9696

97-
/* get peri_base address from device tree node sys_ctrl */
98-
peri_node = of_find_node_by_name(np, "sys_ctrl");
99-
if(!of_address_to_resource(peri_node, 0, &res)) {
100-
pr_warning("of_address_to_resource for peri_node failed\n");
101-
// we should preferably return some error? Or crash here?
102-
}
103-
peri_base = ioremap(res.start, resource_size(&res));
104-
105-
/* get pm_base address from device tree node pm_ctrl */
106-
pm_node = of_find_node_by_name(np, "pm_ctrl");
107-
if(!of_address_to_resource(pm_node, 0, &res)) {
108-
pr_warning("of_address_to_resource for pm_node failed\n");
109-
// we should preferably return some error? Or crash here?
110-
}
111-
pm_base = ioremap(res.start, resource_size(&res));
112-
97+
peri_base = ioremap(SOC_PERI_SCTRL_BASE_ADDR, 0x1000);
98+
pm_base = ioremap(SOC_PMCTRL_BASE_ADDR, 0x1000);
11399
/* SYSPLL is set by bootloader. Read it */
114100
/* check syspll enablement status */
115101
pll_stat = readl(pm_base + SC_PM_SYSPLL_STAT);

0 commit comments

Comments
 (0)