diff options
Diffstat (limited to 'arch/powerpc/kernel/misc_64.S')
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index b3e95ff0dba0..ae1433da09b2 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -604,6 +604,76 @@ _GLOBAL(real_writeb) | |||
604 | #endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ | 604 | #endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ |
605 | 605 | ||
606 | /* | 606 | /* |
607 | * SCOM access functions for 970 (FX only for now) | ||
608 | * | ||
609 | * unsigned long scom970_read(unsigned int address); | ||
610 | * void scom970_write(unsigned int address, unsigned long value); | ||
611 | * | ||
612 | * The address passed in is the 24 bits register address. This code | ||
613 | * is 970 specific and will not check the status bits, so you should | ||
614 | * know what you are doing. | ||
615 | */ | ||
616 | _GLOBAL(scom970_read) | ||
617 | /* interrupts off */ | ||
618 | mfmsr r4 | ||
619 | ori r0,r4,MSR_EE | ||
620 | xori r0,r0,MSR_EE | ||
621 | mtmsrd r0,1 | ||
622 | |||
623 | /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits | ||
624 | * (including parity). On current CPUs they must be 0'd, | ||
625 | * and finally or in RW bit | ||
626 | */ | ||
627 | rlwinm r3,r3,8,0,15 | ||
628 | ori r3,r3,0x8000 | ||
629 | |||
630 | /* do the actual scom read */ | ||
631 | sync | ||
632 | mtspr SPRN_SCOMC,r3 | ||
633 | isync | ||
634 | mfspr r3,SPRN_SCOMD | ||
635 | isync | ||
636 | mfspr r0,SPRN_SCOMC | ||
637 | isync | ||
638 | |||
639 | /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah | ||
640 | * that's the best we can do). Not implemented yet as we don't use | ||
641 | * the scom on any of the bogus CPUs yet, but may have to be done | ||
642 | * ultimately | ||
643 | */ | ||
644 | |||
645 | /* restore interrupts */ | ||
646 | mtmsrd r4,1 | ||
647 | blr | ||
648 | |||
649 | |||
650 | _GLOBAL(scom970_write) | ||
651 | /* interrupts off */ | ||
652 | mfmsr r5 | ||
653 | ori r0,r5,MSR_EE | ||
654 | xori r0,r0,MSR_EE | ||
655 | mtmsrd r0,1 | ||
656 | |||
657 | /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits | ||
658 | * (including parity). On current CPUs they must be 0'd. | ||
659 | */ | ||
660 | |||
661 | rlwinm r3,r3,8,0,15 | ||
662 | |||
663 | sync | ||
664 | mtspr SPRN_SCOMD,r4 /* write data */ | ||
665 | isync | ||
666 | mtspr SPRN_SCOMC,r3 /* write command */ | ||
667 | isync | ||
668 | mfspr 3,SPRN_SCOMC | ||
669 | isync | ||
670 | |||
671 | /* restore interrupts */ | ||
672 | mtmsrd r5,1 | ||
673 | blr | ||
674 | |||
675 | |||
676 | /* | ||
607 | * Create a kernel thread | 677 | * Create a kernel thread |
608 | * kernel_thread(fn, arg, flags) | 678 | * kernel_thread(fn, arg, flags) |
609 | */ | 679 | */ |