common.c (688d794c4c3f8b08c814381ee2edd3ede5856056) | common.c (c3a07134e6aa5b93a37f72ffa3d11fadf72bf757) |
---|---|
1/* 2 * arch/arm/plat-orion/common.c 3 * 4 * Marvell Orion SoC common setup code used by multiple mach-/common.c 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. --- 224 unchanged lines hidden (view full) --- 233 234/***************************************************************************** 235 * GE 236 ****************************************************************************/ 237static __init void ge_complete( 238 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data, 239 struct resource *orion_ge_resource, unsigned long irq, 240 struct platform_device *orion_ge_shared, | 1/* 2 * arch/arm/plat-orion/common.c 3 * 4 * Marvell Orion SoC common setup code used by multiple mach-/common.c 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. --- 224 unchanged lines hidden (view full) --- 233 234/***************************************************************************** 235 * GE 236 ****************************************************************************/ 237static __init void ge_complete( 238 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data, 239 struct resource *orion_ge_resource, unsigned long irq, 240 struct platform_device *orion_ge_shared, |
241 struct platform_device *orion_ge_mvmdio, |
|
241 struct mv643xx_eth_platform_data *eth_data, 242 struct platform_device *orion_ge) 243{ 244 orion_ge_resource->start = irq; 245 orion_ge_resource->end = irq; 246 eth_data->shared = orion_ge_shared; 247 orion_ge->dev.platform_data = eth_data; 248 249 platform_device_register(orion_ge_shared); | 242 struct mv643xx_eth_platform_data *eth_data, 243 struct platform_device *orion_ge) 244{ 245 orion_ge_resource->start = irq; 246 orion_ge_resource->end = irq; 247 eth_data->shared = orion_ge_shared; 248 orion_ge->dev.platform_data = eth_data; 249 250 platform_device_register(orion_ge_shared); |
251 if (orion_ge_mvmdio) 252 platform_device_register(orion_ge_mvmdio); |
|
250 platform_device_register(orion_ge); 251} 252 253/***************************************************************************** 254 * GE00 255 ****************************************************************************/ 256struct mv643xx_eth_shared_platform_data orion_ge00_shared_data; 257 258static struct resource orion_ge00_shared_resources[] = { 259 { 260 .name = "ge00 base", | 253 platform_device_register(orion_ge); 254} 255 256/***************************************************************************** 257 * GE00 258 ****************************************************************************/ 259struct mv643xx_eth_shared_platform_data orion_ge00_shared_data; 260 261static struct resource orion_ge00_shared_resources[] = { 262 { 263 .name = "ge00 base", |
261 }, { 262 .name = "ge00 err irq", | |
263 }, 264}; 265 266static struct platform_device orion_ge00_shared = { 267 .name = MV643XX_ETH_SHARED_NAME, 268 .id = 0, 269 .dev = { 270 .platform_data = &orion_ge00_shared_data, 271 }, 272}; 273 | 264 }, 265}; 266 267static struct platform_device orion_ge00_shared = { 268 .name = MV643XX_ETH_SHARED_NAME, 269 .id = 0, 270 .dev = { 271 .platform_data = &orion_ge00_shared_data, 272 }, 273}; 274 |
275static struct resource orion_ge_mvmdio_resources[] = { 276 { 277 .name = "ge00 mvmdio base", 278 }, { 279 .name = "ge00 mvmdio err irq", 280 }, 281}; 282 283static struct platform_device orion_ge_mvmdio = { 284 .name = "orion-mdio", 285 .id = -1, 286}; 287 |
|
274static struct resource orion_ge00_resources[] = { 275 { 276 .name = "ge00 irq", 277 .flags = IORESOURCE_IRQ, 278 }, 279}; 280 281static struct platform_device orion_ge00 = { --- 8 unchanged lines hidden (view full) --- 290 291void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, 292 unsigned long mapbase, 293 unsigned long irq, 294 unsigned long irq_err, 295 unsigned int tx_csum_limit) 296{ 297 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, | 288static struct resource orion_ge00_resources[] = { 289 { 290 .name = "ge00 irq", 291 .flags = IORESOURCE_IRQ, 292 }, 293}; 294 295static struct platform_device orion_ge00 = { --- 8 unchanged lines hidden (view full) --- 304 305void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, 306 unsigned long mapbase, 307 unsigned long irq, 308 unsigned long irq_err, 309 unsigned int tx_csum_limit) 310{ 311 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, |
298 mapbase + 0x2000, SZ_16K - 1, irq_err); | 312 mapbase + 0x2000, SZ_16K - 1, NO_IRQ); 313 fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources, 314 mapbase + 0x2004, 0x84 - 1, irq_err); |
299 orion_ge00_shared_data.tx_csum_limit = tx_csum_limit; 300 ge_complete(&orion_ge00_shared_data, 301 orion_ge00_resources, irq, &orion_ge00_shared, | 315 orion_ge00_shared_data.tx_csum_limit = tx_csum_limit; 316 ge_complete(&orion_ge00_shared_data, 317 orion_ge00_resources, irq, &orion_ge00_shared, |
318 &orion_ge_mvmdio, |
|
302 eth_data, &orion_ge00); 303} 304 305/***************************************************************************** 306 * GE01 307 ****************************************************************************/ | 319 eth_data, &orion_ge00); 320} 321 322/***************************************************************************** 323 * GE01 324 ****************************************************************************/ |
308struct mv643xx_eth_shared_platform_data orion_ge01_shared_data = { 309 .shared_smi = &orion_ge00_shared, 310}; | 325struct mv643xx_eth_shared_platform_data orion_ge01_shared_data; |
311 312static struct resource orion_ge01_shared_resources[] = { 313 { 314 .name = "ge01 base", | 326 327static struct resource orion_ge01_shared_resources[] = { 328 { 329 .name = "ge01 base", |
315 }, { 316 .name = "ge01 err irq", 317 }, | 330 } |
318}; 319 320static struct platform_device orion_ge01_shared = { 321 .name = MV643XX_ETH_SHARED_NAME, 322 .id = 1, 323 .dev = { 324 .platform_data = &orion_ge01_shared_data, 325 }, --- 18 unchanged lines hidden (view full) --- 344 345void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, 346 unsigned long mapbase, 347 unsigned long irq, 348 unsigned long irq_err, 349 unsigned int tx_csum_limit) 350{ 351 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, | 331}; 332 333static struct platform_device orion_ge01_shared = { 334 .name = MV643XX_ETH_SHARED_NAME, 335 .id = 1, 336 .dev = { 337 .platform_data = &orion_ge01_shared_data, 338 }, --- 18 unchanged lines hidden (view full) --- 357 358void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, 359 unsigned long mapbase, 360 unsigned long irq, 361 unsigned long irq_err, 362 unsigned int tx_csum_limit) 363{ 364 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, |
352 mapbase + 0x2000, SZ_16K - 1, irq_err); | 365 mapbase + 0x2000, SZ_16K - 1, NO_IRQ); |
353 orion_ge01_shared_data.tx_csum_limit = tx_csum_limit; 354 ge_complete(&orion_ge01_shared_data, 355 orion_ge01_resources, irq, &orion_ge01_shared, | 366 orion_ge01_shared_data.tx_csum_limit = tx_csum_limit; 367 ge_complete(&orion_ge01_shared_data, 368 orion_ge01_resources, irq, &orion_ge01_shared, |
369 NULL, |
|
356 eth_data, &orion_ge01); 357} 358 359/***************************************************************************** 360 * GE10 361 ****************************************************************************/ | 370 eth_data, &orion_ge01); 371} 372 373/***************************************************************************** 374 * GE10 375 ****************************************************************************/ |
362struct mv643xx_eth_shared_platform_data orion_ge10_shared_data = { 363 .shared_smi = &orion_ge00_shared, 364}; | 376struct mv643xx_eth_shared_platform_data orion_ge10_shared_data; |
365 366static struct resource orion_ge10_shared_resources[] = { 367 { 368 .name = "ge10 base", | 377 378static struct resource orion_ge10_shared_resources[] = { 379 { 380 .name = "ge10 base", |
369 }, { 370 .name = "ge10 err irq", 371 }, | 381 } |
372}; 373 374static struct platform_device orion_ge10_shared = { 375 .name = MV643XX_ETH_SHARED_NAME, 376 .id = 1, 377 .dev = { 378 .platform_data = &orion_ge10_shared_data, 379 }, --- 17 unchanged lines hidden (view full) --- 397}; 398 399void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, 400 unsigned long mapbase, 401 unsigned long irq, 402 unsigned long irq_err) 403{ 404 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources, | 382}; 383 384static struct platform_device orion_ge10_shared = { 385 .name = MV643XX_ETH_SHARED_NAME, 386 .id = 1, 387 .dev = { 388 .platform_data = &orion_ge10_shared_data, 389 }, --- 17 unchanged lines hidden (view full) --- 407}; 408 409void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, 410 unsigned long mapbase, 411 unsigned long irq, 412 unsigned long irq_err) 413{ 414 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources, |
405 mapbase + 0x2000, SZ_16K - 1, irq_err); | 415 mapbase + 0x2000, SZ_16K - 1, NO_IRQ); |
406 ge_complete(&orion_ge10_shared_data, 407 orion_ge10_resources, irq, &orion_ge10_shared, | 416 ge_complete(&orion_ge10_shared_data, 417 orion_ge10_resources, irq, &orion_ge10_shared, |
418 NULL, |
|
408 eth_data, &orion_ge10); 409} 410 411/***************************************************************************** 412 * GE11 413 ****************************************************************************/ | 419 eth_data, &orion_ge10); 420} 421 422/***************************************************************************** 423 * GE11 424 ****************************************************************************/ |
414struct mv643xx_eth_shared_platform_data orion_ge11_shared_data = { 415 .shared_smi = &orion_ge00_shared, 416}; | 425struct mv643xx_eth_shared_platform_data orion_ge11_shared_data; |
417 418static struct resource orion_ge11_shared_resources[] = { 419 { 420 .name = "ge11 base", | 426 427static struct resource orion_ge11_shared_resources[] = { 428 { 429 .name = "ge11 base", |
421 }, { 422 .name = "ge11 err irq", | |
423 }, 424}; 425 426static struct platform_device orion_ge11_shared = { 427 .name = MV643XX_ETH_SHARED_NAME, 428 .id = 1, 429 .dev = { 430 .platform_data = &orion_ge11_shared_data, --- 18 unchanged lines hidden (view full) --- 449}; 450 451void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, 452 unsigned long mapbase, 453 unsigned long irq, 454 unsigned long irq_err) 455{ 456 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources, | 430 }, 431}; 432 433static struct platform_device orion_ge11_shared = { 434 .name = MV643XX_ETH_SHARED_NAME, 435 .id = 1, 436 .dev = { 437 .platform_data = &orion_ge11_shared_data, --- 18 unchanged lines hidden (view full) --- 456}; 457 458void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, 459 unsigned long mapbase, 460 unsigned long irq, 461 unsigned long irq_err) 462{ 463 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources, |
457 mapbase + 0x2000, SZ_16K - 1, irq_err); | 464 mapbase + 0x2000, SZ_16K - 1, NO_IRQ); |
458 ge_complete(&orion_ge11_shared_data, 459 orion_ge11_resources, irq, &orion_ge11_shared, | 465 ge_complete(&orion_ge11_shared_data, 466 orion_ge11_resources, irq, &orion_ge11_shared, |
467 NULL, |
|
460 eth_data, &orion_ge11); 461} 462 463/***************************************************************************** 464 * Ethernet switch 465 ****************************************************************************/ 466static struct resource orion_switch_resources[] = { 467 { --- 416 unchanged lines hidden --- | 468 eth_data, &orion_ge11); 469} 470 471/***************************************************************************** 472 * Ethernet switch 473 ****************************************************************************/ 474static struct resource orion_switch_resources[] = { 475 { --- 416 unchanged lines hidden --- |