diff options
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/cpm2.c | 1 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_dev.c | 78 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_pci.c | 6 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_pic.c | 4 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_udbg.c | 2 |
5 files changed, 47 insertions, 44 deletions
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c index 803b59cc047b..fa70ee31349e 100644 --- a/arch/powerpc/sysdev/cpm2.c +++ b/arch/powerpc/sysdev/cpm2.c | |||
@@ -240,6 +240,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) | |||
240 | case CPM_CLK_SCC1: | 240 | case CPM_CLK_SCC1: |
241 | reg = &im_cpmux->cmx_scr; | 241 | reg = &im_cpmux->cmx_scr; |
242 | shift = 24; | 242 | shift = 24; |
243 | break; | ||
243 | case CPM_CLK_SCC2: | 244 | case CPM_CLK_SCC2: |
244 | reg = &im_cpmux->cmx_scr; | 245 | reg = &im_cpmux->cmx_scr; |
245 | shift = 16; | 246 | shift = 16; |
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c index efda0028909d..047b31027fa6 100644 --- a/arch/powerpc/sysdev/mv64x60_dev.c +++ b/arch/powerpc/sysdev/mv64x60_dev.c | |||
@@ -127,7 +127,7 @@ static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id) | |||
127 | if (err) | 127 | if (err) |
128 | return err; | 128 | return err; |
129 | 129 | ||
130 | prop = of_get_property(np, "block-index", NULL); | 130 | prop = of_get_property(np, "cell-index", NULL); |
131 | if (!prop) | 131 | if (!prop) |
132 | return -ENODEV; | 132 | return -ENODEV; |
133 | port_number = *(int *)prop; | 133 | port_number = *(int *)prop; |
@@ -136,6 +136,7 @@ static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id) | |||
136 | 136 | ||
137 | pdata.cache_mgmt = 1; /* All current revs need this set */ | 137 | pdata.cache_mgmt = 1; /* All current revs need this set */ |
138 | 138 | ||
139 | pdata.max_idle = 40; /* default */ | ||
139 | prop = of_get_property(np, "max_idle", NULL); | 140 | prop = of_get_property(np, "max_idle", NULL); |
140 | if (prop) | 141 | if (prop) |
141 | pdata.max_idle = *prop; | 142 | pdata.max_idle = *prop; |
@@ -205,30 +206,24 @@ error: | |||
205 | /* | 206 | /* |
206 | * Create mv64x60_eth platform devices | 207 | * Create mv64x60_eth platform devices |
207 | */ | 208 | */ |
208 | static int __init eth_register_shared_pdev(struct device_node *np) | 209 | static struct platform_device * __init mv64x60_eth_register_shared_pdev( |
210 | struct device_node *np, int id) | ||
209 | { | 211 | { |
210 | struct platform_device *pdev; | 212 | struct platform_device *pdev; |
211 | struct resource r[1]; | 213 | struct resource r[1]; |
212 | int err; | 214 | int err; |
213 | 215 | ||
214 | np = of_get_parent(np); | ||
215 | if (!np) | ||
216 | return -ENODEV; | ||
217 | |||
218 | err = of_address_to_resource(np, 0, &r[0]); | 216 | err = of_address_to_resource(np, 0, &r[0]); |
219 | of_node_put(np); | ||
220 | if (err) | 217 | if (err) |
221 | return err; | 218 | return ERR_PTR(err); |
222 | 219 | ||
223 | pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, 0, | 220 | pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, id, |
224 | r, 1); | 221 | r, 1); |
225 | if (IS_ERR(pdev)) | 222 | return pdev; |
226 | return PTR_ERR(pdev); | ||
227 | |||
228 | return 0; | ||
229 | } | 223 | } |
230 | 224 | ||
231 | static int __init mv64x60_eth_device_setup(struct device_node *np, int id) | 225 | static int __init mv64x60_eth_device_setup(struct device_node *np, int id, |
226 | struct platform_device *shared_pdev) | ||
232 | { | 227 | { |
233 | struct resource r[1]; | 228 | struct resource r[1]; |
234 | struct mv643xx_eth_platform_data pdata; | 229 | struct mv643xx_eth_platform_data pdata; |
@@ -239,16 +234,12 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id) | |||
239 | const phandle *ph; | 234 | const phandle *ph; |
240 | int err; | 235 | int err; |
241 | 236 | ||
242 | /* only register the shared platform device the first time through */ | ||
243 | if (id == 0 && (err = eth_register_shared_pdev(np))) | ||
244 | return err; | ||
245 | |||
246 | memset(r, 0, sizeof(r)); | 237 | memset(r, 0, sizeof(r)); |
247 | of_irq_to_resource(np, 0, &r[0]); | 238 | of_irq_to_resource(np, 0, &r[0]); |
248 | 239 | ||
249 | memset(&pdata, 0, sizeof(pdata)); | 240 | memset(&pdata, 0, sizeof(pdata)); |
250 | 241 | ||
251 | prop = of_get_property(np, "block-index", NULL); | 242 | prop = of_get_property(np, "reg", NULL); |
252 | if (!prop) | 243 | if (!prop) |
253 | return -ENODEV; | 244 | return -ENODEV; |
254 | pdata.port_number = *prop; | 245 | pdata.port_number = *prop; |
@@ -301,7 +292,7 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id) | |||
301 | 292 | ||
302 | of_node_put(phy); | 293 | of_node_put(phy); |
303 | 294 | ||
304 | pdev = platform_device_alloc(MV643XX_ETH_NAME, pdata.port_number); | 295 | pdev = platform_device_alloc(MV643XX_ETH_NAME, id); |
305 | if (!pdev) | 296 | if (!pdev) |
306 | return -ENOMEM; | 297 | return -ENOMEM; |
307 | 298 | ||
@@ -345,21 +336,19 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id) | |||
345 | 336 | ||
346 | memset(&pdata, 0, sizeof(pdata)); | 337 | memset(&pdata, 0, sizeof(pdata)); |
347 | 338 | ||
339 | pdata.freq_m = 8; /* default */ | ||
348 | prop = of_get_property(np, "freq_m", NULL); | 340 | prop = of_get_property(np, "freq_m", NULL); |
349 | if (!prop) | 341 | if (!prop) |
350 | return -ENODEV; | 342 | return -ENODEV; |
351 | pdata.freq_m = *prop; | 343 | pdata.freq_m = *prop; |
352 | 344 | ||
345 | pdata.freq_m = 3; /* default */ | ||
353 | prop = of_get_property(np, "freq_n", NULL); | 346 | prop = of_get_property(np, "freq_n", NULL); |
354 | if (!prop) | 347 | if (!prop) |
355 | return -ENODEV; | 348 | return -ENODEV; |
356 | pdata.freq_n = *prop; | 349 | pdata.freq_n = *prop; |
357 | 350 | ||
358 | prop = of_get_property(np, "timeout", NULL); | 351 | pdata.timeout = 1000; /* default: 1 second */ |
359 | if (prop) | ||
360 | pdata.timeout = *prop; | ||
361 | else | ||
362 | pdata.timeout = 1000; /* 1 second */ | ||
363 | 352 | ||
364 | pdev = platform_device_alloc(MV64XXX_I2C_CTLR_NAME, id); | 353 | pdev = platform_device_alloc(MV64XXX_I2C_CTLR_NAME, id); |
365 | if (!pdev) | 354 | if (!pdev) |
@@ -401,10 +390,7 @@ static int __init mv64x60_wdt_device_setup(struct device_node *np, int id) | |||
401 | 390 | ||
402 | memset(&pdata, 0, sizeof(pdata)); | 391 | memset(&pdata, 0, sizeof(pdata)); |
403 | 392 | ||
404 | prop = of_get_property(np, "timeout", NULL); | 393 | pdata.timeout = 10; /* Default: 10 seconds */ |
405 | if (!prop) | ||
406 | return -ENODEV; | ||
407 | pdata.timeout = *prop; | ||
408 | 394 | ||
409 | np = of_get_parent(np); | 395 | np = of_get_parent(np); |
410 | if (!np) | 396 | if (!np) |
@@ -441,27 +427,43 @@ error: | |||
441 | 427 | ||
442 | static int __init mv64x60_device_setup(void) | 428 | static int __init mv64x60_device_setup(void) |
443 | { | 429 | { |
444 | struct device_node *np = NULL; | 430 | struct device_node *np, *np2; |
445 | int id; | 431 | struct platform_device *pdev; |
432 | int id, id2; | ||
446 | int err; | 433 | int err; |
447 | 434 | ||
448 | id = 0; | 435 | id = 0; |
449 | for_each_compatible_node(np, "serial", "marvell,mpsc") | 436 | for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") |
450 | if ((err = mv64x60_mpsc_device_setup(np, id++))) | 437 | if ((err = mv64x60_mpsc_device_setup(np, id++))) |
451 | goto error; | 438 | goto error; |
452 | 439 | ||
453 | id = 0; | 440 | id = 0; |
454 | for_each_compatible_node(np, "network", "marvell,mv64x60-eth") | 441 | id2 = 0; |
455 | if ((err = mv64x60_eth_device_setup(np, id++))) | 442 | for_each_compatible_node(np, NULL, "marvell,mv64360-eth-group") { |
443 | pdev = mv64x60_eth_register_shared_pdev(np, id++); | ||
444 | if (IS_ERR(pdev)) { | ||
445 | err = PTR_ERR(pdev); | ||
456 | goto error; | 446 | goto error; |
447 | } | ||
448 | for_each_child_of_node(np, np2) { | ||
449 | if (!of_device_is_compatible(np2, | ||
450 | "marvell,mv64360-eth")) | ||
451 | continue; | ||
452 | err = mv64x60_eth_device_setup(np2, id2++, pdev); | ||
453 | if (err) { | ||
454 | of_node_put(np2); | ||
455 | goto error; | ||
456 | } | ||
457 | } | ||
458 | } | ||
457 | 459 | ||
458 | id = 0; | 460 | id = 0; |
459 | for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c") | 461 | for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c") |
460 | if ((err = mv64x60_i2c_device_setup(np, id++))) | 462 | if ((err = mv64x60_i2c_device_setup(np, id++))) |
461 | goto error; | 463 | goto error; |
462 | 464 | ||
463 | /* support up to one watchdog timer */ | 465 | /* support up to one watchdog timer */ |
464 | np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt"); | 466 | np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt"); |
465 | if (np) { | 467 | if (np) { |
466 | if ((err = mv64x60_wdt_device_setup(np, id))) | 468 | if ((err = mv64x60_wdt_device_setup(np, id))) |
467 | goto error; | 469 | goto error; |
@@ -489,10 +491,10 @@ static int __init mv64x60_add_mpsc_console(void) | |||
489 | if (!np) | 491 | if (!np) |
490 | goto not_mpsc; | 492 | goto not_mpsc; |
491 | 493 | ||
492 | if (!of_device_is_compatible(np, "marvell,mpsc")) | 494 | if (!of_device_is_compatible(np, "marvell,mv64360-mpsc")) |
493 | goto not_mpsc; | 495 | goto not_mpsc; |
494 | 496 | ||
495 | prop = of_get_property(np, "block-index", NULL); | 497 | prop = of_get_property(np, "cell-index", NULL); |
496 | if (!prop) | 498 | if (!prop) |
497 | goto not_mpsc; | 499 | goto not_mpsc; |
498 | 500 | ||
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c index d21ab8fa4993..1456015a22d8 100644 --- a/arch/powerpc/sysdev/mv64x60_pci.c +++ b/arch/powerpc/sysdev/mv64x60_pci.c | |||
@@ -86,14 +86,14 @@ static int __init mv64x60_sysfs_init(void) | |||
86 | struct platform_device *pdev; | 86 | struct platform_device *pdev; |
87 | const unsigned int *prop; | 87 | const unsigned int *prop; |
88 | 88 | ||
89 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60"); | 89 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64360"); |
90 | if (!np) | 90 | if (!np) |
91 | return 0; | 91 | return 0; |
92 | 92 | ||
93 | prop = of_get_property(np, "hs_reg_valid", NULL); | 93 | prop = of_get_property(np, "hs_reg_valid", NULL); |
94 | of_node_put(np); | 94 | of_node_put(np); |
95 | 95 | ||
96 | pdev = platform_device_register_simple("marvell,mv64x60", 0, NULL, 0); | 96 | pdev = platform_device_register_simple("marvell,mv64360", 0, NULL, 0); |
97 | if (IS_ERR(pdev)) | 97 | if (IS_ERR(pdev)) |
98 | return PTR_ERR(pdev); | 98 | return PTR_ERR(pdev); |
99 | 99 | ||
@@ -166,6 +166,6 @@ void __init mv64x60_pci_init(void) | |||
166 | { | 166 | { |
167 | struct device_node *np; | 167 | struct device_node *np; |
168 | 168 | ||
169 | for_each_compatible_node(np, "pci", "marvell,mv64x60-pci") | 169 | for_each_compatible_node(np, "pci", "marvell,mv64360-pci") |
170 | mv64x60_add_bridge(np); | 170 | mv64x60_add_bridge(np); |
171 | } | 171 | } |
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c index 19e6ef263797..2aa4ed066db1 100644 --- a/arch/powerpc/sysdev/mv64x60_pic.c +++ b/arch/powerpc/sysdev/mv64x60_pic.c | |||
@@ -238,13 +238,13 @@ void __init mv64x60_init_irq(void) | |||
238 | const unsigned int *reg; | 238 | const unsigned int *reg; |
239 | unsigned long flags; | 239 | unsigned long flags; |
240 | 240 | ||
241 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp"); | 241 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp"); |
242 | reg = of_get_property(np, "reg", &size); | 242 | reg = of_get_property(np, "reg", &size); |
243 | paddr = of_translate_address(np, reg); | 243 | paddr = of_translate_address(np, reg); |
244 | mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); | 244 | mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); |
245 | of_node_put(np); | 245 | of_node_put(np); |
246 | 246 | ||
247 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic"); | 247 | np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-pic"); |
248 | reg = of_get_property(np, "reg", &size); | 248 | reg = of_get_property(np, "reg", &size); |
249 | paddr = of_translate_address(np, reg); | 249 | paddr = of_translate_address(np, reg); |
250 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); | 250 | mv64x60_irq_reg_base = ioremap(paddr, reg[1]); |
diff --git a/arch/powerpc/sysdev/mv64x60_udbg.c b/arch/powerpc/sysdev/mv64x60_udbg.c index 35c77c7d0616..ccdb3b0418fc 100644 --- a/arch/powerpc/sysdev/mv64x60_udbg.c +++ b/arch/powerpc/sysdev/mv64x60_udbg.c | |||
@@ -85,7 +85,7 @@ static void mv64x60_udbg_init(void) | |||
85 | if (!stdout) | 85 | if (!stdout) |
86 | return; | 86 | return; |
87 | 87 | ||
88 | for_each_compatible_node(np, "serial", "marvell,mpsc") { | 88 | for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") { |
89 | if (np == stdout) | 89 | if (np == stdout) |
90 | break; | 90 | break; |
91 | } | 91 | } |