diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-12-06 09:53:44 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-10 21:42:24 -0500 |
commit | 344893884685c1c4ec38d7c1e6f719c0030f7f9c (patch) | |
tree | 31d0ab30870b71103280649e047835881d45aba7 /arch/powerpc | |
parent | 0d416f2a9eb31823f824ac067be7771fd93bffa3 (diff) |
[POWERPC] iSeries: Remove one layer of IO routines
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 68 |
1 files changed, 19 insertions, 49 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 105b23d33608..8844d3e488df 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -382,7 +382,7 @@ static inline struct device_node *xlate_iomm_address( | |||
382 | * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal | 382 | * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal |
383 | * else, data is returned in Big Endian format. | 383 | * else, data is returned in Big Endian format. |
384 | */ | 384 | */ |
385 | static u8 iSeries_read_byte(const volatile void __iomem *addr) | 385 | static u8 iseries_readb(const volatile void __iomem *addr) |
386 | { | 386 | { |
387 | u64 bar_offset; | 387 | u64 bar_offset; |
388 | u64 dsa; | 388 | u64 dsa; |
@@ -400,7 +400,7 @@ static u8 iSeries_read_byte(const volatile void __iomem *addr) | |||
400 | return ret.value; | 400 | return ret.value; |
401 | } | 401 | } |
402 | 402 | ||
403 | static u16 iSeries_read_word(const volatile void __iomem *addr) | 403 | static u16 iseries_readw_be(const volatile void __iomem *addr) |
404 | { | 404 | { |
405 | u64 bar_offset; | 405 | u64 bar_offset; |
406 | u64 dsa; | 406 | u64 dsa; |
@@ -419,7 +419,7 @@ static u16 iSeries_read_word(const volatile void __iomem *addr) | |||
419 | return ret.value; | 419 | return ret.value; |
420 | } | 420 | } |
421 | 421 | ||
422 | static u32 iSeries_read_long(const volatile void __iomem *addr) | 422 | static u32 iseries_readl_be(const volatile void __iomem *addr) |
423 | { | 423 | { |
424 | u64 bar_offset; | 424 | u64 bar_offset; |
425 | u64 dsa; | 425 | u64 dsa; |
@@ -442,7 +442,7 @@ static u32 iSeries_read_long(const volatile void __iomem *addr) | |||
442 | * Write MM I/O Instructions for the iSeries | 442 | * Write MM I/O Instructions for the iSeries |
443 | * | 443 | * |
444 | */ | 444 | */ |
445 | static void iSeries_write_byte(u8 data, volatile void __iomem *addr) | 445 | static void iseries_writeb(u8 data, volatile void __iomem *addr) |
446 | { | 446 | { |
447 | u64 bar_offset; | 447 | u64 bar_offset; |
448 | u64 dsa; | 448 | u64 dsa; |
@@ -458,7 +458,7 @@ static void iSeries_write_byte(u8 data, volatile void __iomem *addr) | |||
458 | } while (check_return_code("WWB", dn, &retry, rc) != 0); | 458 | } while (check_return_code("WWB", dn, &retry, rc) != 0); |
459 | } | 459 | } |
460 | 460 | ||
461 | static void iSeries_write_word(u16 data, volatile void __iomem *addr) | 461 | static void iseries_writew_be(u16 data, volatile void __iomem *addr) |
462 | { | 462 | { |
463 | u64 bar_offset; | 463 | u64 bar_offset; |
464 | u64 dsa; | 464 | u64 dsa; |
@@ -474,7 +474,7 @@ static void iSeries_write_word(u16 data, volatile void __iomem *addr) | |||
474 | } while (check_return_code("WWW", dn, &retry, rc) != 0); | 474 | } while (check_return_code("WWW", dn, &retry, rc) != 0); |
475 | } | 475 | } |
476 | 476 | ||
477 | static void iSeries_write_long(u32 data, volatile void __iomem *addr) | 477 | static void iseries_writel_be(u32 data, volatile void __iomem *addr) |
478 | { | 478 | { |
479 | u64 bar_offset; | 479 | u64 bar_offset; |
480 | u64 dsa; | 480 | u64 dsa; |
@@ -490,54 +490,24 @@ static void iSeries_write_long(u32 data, volatile void __iomem *addr) | |||
490 | } while (check_return_code("WWL", dn, &retry, rc) != 0); | 490 | } while (check_return_code("WWL", dn, &retry, rc) != 0); |
491 | } | 491 | } |
492 | 492 | ||
493 | static u8 iseries_readb(const volatile void __iomem *addr) | ||
494 | { | ||
495 | return iSeries_read_byte(addr); | ||
496 | } | ||
497 | |||
498 | static u16 iseries_readw(const volatile void __iomem *addr) | 493 | static u16 iseries_readw(const volatile void __iomem *addr) |
499 | { | 494 | { |
500 | return le16_to_cpu(iSeries_read_word(addr)); | 495 | return le16_to_cpu(iseries_readw_be(addr)); |
501 | } | 496 | } |
502 | 497 | ||
503 | static u32 iseries_readl(const volatile void __iomem *addr) | 498 | static u32 iseries_readl(const volatile void __iomem *addr) |
504 | { | 499 | { |
505 | return le32_to_cpu(iSeries_read_long(addr)); | 500 | return le32_to_cpu(iseries_readl_be(addr)); |
506 | } | ||
507 | |||
508 | static u16 iseries_readw_be(const volatile void __iomem *addr) | ||
509 | { | ||
510 | return iSeries_read_word(addr); | ||
511 | } | ||
512 | |||
513 | static u32 iseries_readl_be(const volatile void __iomem *addr) | ||
514 | { | ||
515 | return iSeries_read_long(addr); | ||
516 | } | ||
517 | |||
518 | static void iseries_writeb(u8 data, volatile void __iomem *addr) | ||
519 | { | ||
520 | iSeries_write_byte(data, addr); | ||
521 | } | 501 | } |
522 | 502 | ||
523 | static void iseries_writew(u16 data, volatile void __iomem *addr) | 503 | static void iseries_writew(u16 data, volatile void __iomem *addr) |
524 | { | 504 | { |
525 | iSeries_write_word(cpu_to_le16(data), addr); | 505 | iseries_writew_be(cpu_to_le16(data), addr); |
526 | } | 506 | } |
527 | 507 | ||
528 | static void iseries_writel(u32 data, volatile void __iomem *addr) | 508 | static void iseries_writel(u32 data, volatile void __iomem *addr) |
529 | { | 509 | { |
530 | iSeries_write_long(cpu_to_le32(data), addr); | 510 | iseries_writel(cpu_to_le32(data), addr); |
531 | } | ||
532 | |||
533 | static void iseries_writew_be(u16 data, volatile void __iomem *addr) | ||
534 | { | ||
535 | iSeries_write_word(data, addr); | ||
536 | } | ||
537 | |||
538 | static void iseries_writel_be(u32 data, volatile void __iomem *addr) | ||
539 | { | ||
540 | iSeries_write_long(data, addr); | ||
541 | } | 511 | } |
542 | 512 | ||
543 | static void iseries_readsb(const volatile void __iomem *addr, void *buf, | 513 | static void iseries_readsb(const volatile void __iomem *addr, void *buf, |
@@ -545,7 +515,7 @@ static void iseries_readsb(const volatile void __iomem *addr, void *buf, | |||
545 | { | 515 | { |
546 | u8 *dst = buf; | 516 | u8 *dst = buf; |
547 | while(count-- > 0) | 517 | while(count-- > 0) |
548 | *(dst++) = iSeries_read_byte(addr); | 518 | *(dst++) = iseries_readb(addr); |
549 | } | 519 | } |
550 | 520 | ||
551 | static void iseries_readsw(const volatile void __iomem *addr, void *buf, | 521 | static void iseries_readsw(const volatile void __iomem *addr, void *buf, |
@@ -553,7 +523,7 @@ static void iseries_readsw(const volatile void __iomem *addr, void *buf, | |||
553 | { | 523 | { |
554 | u16 *dst = buf; | 524 | u16 *dst = buf; |
555 | while(count-- > 0) | 525 | while(count-- > 0) |
556 | *(dst++) = iSeries_read_word(addr); | 526 | *(dst++) = iseries_readw_be(addr); |
557 | } | 527 | } |
558 | 528 | ||
559 | static void iseries_readsl(const volatile void __iomem *addr, void *buf, | 529 | static void iseries_readsl(const volatile void __iomem *addr, void *buf, |
@@ -561,7 +531,7 @@ static void iseries_readsl(const volatile void __iomem *addr, void *buf, | |||
561 | { | 531 | { |
562 | u32 *dst = buf; | 532 | u32 *dst = buf; |
563 | while(count-- > 0) | 533 | while(count-- > 0) |
564 | *(dst++) = iSeries_read_long(addr); | 534 | *(dst++) = iseries_readl_be(addr); |
565 | } | 535 | } |
566 | 536 | ||
567 | static void iseries_writesb(volatile void __iomem *addr, const void *buf, | 537 | static void iseries_writesb(volatile void __iomem *addr, const void *buf, |
@@ -569,7 +539,7 @@ static void iseries_writesb(volatile void __iomem *addr, const void *buf, | |||
569 | { | 539 | { |
570 | const u8 *src = buf; | 540 | const u8 *src = buf; |
571 | while(count-- > 0) | 541 | while(count-- > 0) |
572 | iSeries_write_byte(*(src++), addr); | 542 | iseries_writeb(*(src++), addr); |
573 | } | 543 | } |
574 | 544 | ||
575 | static void iseries_writesw(volatile void __iomem *addr, const void *buf, | 545 | static void iseries_writesw(volatile void __iomem *addr, const void *buf, |
@@ -577,7 +547,7 @@ static void iseries_writesw(volatile void __iomem *addr, const void *buf, | |||
577 | { | 547 | { |
578 | const u16 *src = buf; | 548 | const u16 *src = buf; |
579 | while(count-- > 0) | 549 | while(count-- > 0) |
580 | iSeries_write_word(*(src++), addr); | 550 | iseries_writew_be(*(src++), addr); |
581 | } | 551 | } |
582 | 552 | ||
583 | static void iseries_writesl(volatile void __iomem *addr, const void *buf, | 553 | static void iseries_writesl(volatile void __iomem *addr, const void *buf, |
@@ -585,7 +555,7 @@ static void iseries_writesl(volatile void __iomem *addr, const void *buf, | |||
585 | { | 555 | { |
586 | const u32 *src = buf; | 556 | const u32 *src = buf; |
587 | while(count-- > 0) | 557 | while(count-- > 0) |
588 | iSeries_write_long(*(src++), addr); | 558 | iseries_writel_be(*(src++), addr); |
589 | } | 559 | } |
590 | 560 | ||
591 | static void iseries_memset_io(volatile void __iomem *addr, int c, | 561 | static void iseries_memset_io(volatile void __iomem *addr, int c, |
@@ -594,7 +564,7 @@ static void iseries_memset_io(volatile void __iomem *addr, int c, | |||
594 | volatile char __iomem *d = addr; | 564 | volatile char __iomem *d = addr; |
595 | 565 | ||
596 | while (n-- > 0) | 566 | while (n-- > 0) |
597 | iSeries_write_byte(c, d++); | 567 | iseries_writeb(c, d++); |
598 | } | 568 | } |
599 | 569 | ||
600 | static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src, | 570 | static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src, |
@@ -604,7 +574,7 @@ static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src, | |||
604 | const volatile char __iomem *s = src; | 574 | const volatile char __iomem *s = src; |
605 | 575 | ||
606 | while (n-- > 0) | 576 | while (n-- > 0) |
607 | *d++ = iSeries_read_byte(s++); | 577 | *d++ = iseries_readb(s++); |
608 | } | 578 | } |
609 | 579 | ||
610 | static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src, | 580 | static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src, |
@@ -614,7 +584,7 @@ static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src, | |||
614 | volatile char __iomem *d = dest; | 584 | volatile char __iomem *d = dest; |
615 | 585 | ||
616 | while (n-- > 0) | 586 | while (n-- > 0) |
617 | iSeries_write_byte(*s++, d++); | 587 | iseries_writeb(*s++, d++); |
618 | } | 588 | } |
619 | 589 | ||
620 | /* We only set MMIO ops. The default PIO ops will be default | 590 | /* We only set MMIO ops. The default PIO ops will be default |