diff options
author | Kyle Moffett <Kyle.D.Moffett@boeing.com> | 2011-12-02 01:28:01 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-12-06 21:43:07 -0500 |
commit | e7a98675caf272a11dc1012c7a8c6c00cab09f5b (patch) | |
tree | 856c69993207021ffda5550d3e12d88de7381e15 /arch/powerpc/platforms/embedded6xx/storcenter.c | |
parent | 5bdb6f2e5833c1c3e5ea21a2050fe0fada3a4a1d (diff) |
powerpc/mpic: Save computed phys_addr for board-specific code
The MPIC code can already perform an automatic OF address translation
step as part of mpic_alloc(), but several boards need to use that base
address when they perform mpic_assign_isu().
The easiest solution is to save the computed physical address into the
"struct mpic" for later use by the board code.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/embedded6xx/storcenter.c')
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/storcenter.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c index f1eebcae9bf0..084f0fc706b7 100644 --- a/arch/powerpc/platforms/embedded6xx/storcenter.c +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c | |||
@@ -84,22 +84,12 @@ static void __init storcenter_init_IRQ(void) | |||
84 | { | 84 | { |
85 | struct mpic *mpic; | 85 | struct mpic *mpic; |
86 | struct device_node *dnp; | 86 | struct device_node *dnp; |
87 | const void *prop; | ||
88 | int size; | ||
89 | phys_addr_t paddr; | ||
90 | 87 | ||
91 | dnp = of_find_node_by_type(NULL, "open-pic"); | 88 | dnp = of_find_node_by_type(NULL, "open-pic"); |
92 | if (dnp == NULL) | 89 | if (dnp == NULL) |
93 | return; | 90 | return; |
94 | 91 | ||
95 | prop = of_get_property(dnp, "reg", &size); | 92 | mpic = mpic_alloc(dnp, 0, MPIC_PRIMARY | MPIC_WANTS_RESET, |
96 | if (prop == NULL) { | ||
97 | of_node_put(dnp); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | paddr = (phys_addr_t)of_translate_address(dnp, prop); | ||
102 | mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, | ||
103 | 16, 32, " OpenPIC "); | 93 | 16, 32, " OpenPIC "); |
104 | 94 | ||
105 | of_node_put(dnp); | 95 | of_node_put(dnp); |
@@ -110,8 +100,8 @@ static void __init storcenter_init_IRQ(void) | |||
110 | * 16 Serial Interrupts followed by 16 Internal Interrupts. | 100 | * 16 Serial Interrupts followed by 16 Internal Interrupts. |
111 | * I2C is the second internal, so it is at 17, 0x11020. | 101 | * I2C is the second internal, so it is at 17, 0x11020. |
112 | */ | 102 | */ |
113 | mpic_assign_isu(mpic, 0, paddr + 0x10200); | 103 | mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200); |
114 | mpic_assign_isu(mpic, 1, paddr + 0x11000); | 104 | mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000); |
115 | 105 | ||
116 | mpic_init(mpic); | 106 | mpic_init(mpic); |
117 | } | 107 | } |