diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/repository.c | 66 |
2 files changed, 73 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 4012a86515cd..d71329a8e325 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -188,6 +188,13 @@ int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size); | |||
188 | int ps3_repository_read_region_total(u64 *region_total); | 188 | int ps3_repository_read_region_total(u64 *region_total); |
189 | int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, | 189 | int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, |
190 | u64 *region_total); | 190 | u64 *region_total); |
191 | int ps3_repository_read_highmem_region_count(unsigned int *region_count); | ||
192 | int ps3_repository_read_highmem_base(unsigned int region_index, | ||
193 | u64 *highmem_base); | ||
194 | int ps3_repository_read_highmem_size(unsigned int region_index, | ||
195 | u64 *highmem_size); | ||
196 | int ps3_repository_read_highmem_info(unsigned int region_index, | ||
197 | u64 *highmem_base, u64 *highmem_size); | ||
191 | 198 | ||
192 | int ps3_repository_write_highmem_region_count(unsigned int region_count); | 199 | int ps3_repository_write_highmem_region_count(unsigned int region_count); |
193 | int ps3_repository_write_highmem_base(unsigned int region_index, | 200 | int ps3_repository_write_highmem_base(unsigned int region_index, |
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index c73f3a68d2a7..9b47ba7a5de7 100644 --- a/arch/powerpc/platforms/ps3/repository.c +++ b/arch/powerpc/platforms/ps3/repository.c | |||
@@ -779,6 +779,72 @@ int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, u64 *region_total) | |||
779 | } | 779 | } |
780 | 780 | ||
781 | /** | 781 | /** |
782 | * ps3_repository_read_highmem_region_count - Read the number of highmem regions | ||
783 | * | ||
784 | * Bootloaders must arrange the repository nodes such that regions are indexed | ||
785 | * with a region_index from 0 to region_count-1. | ||
786 | */ | ||
787 | |||
788 | int ps3_repository_read_highmem_region_count(unsigned int *region_count) | ||
789 | { | ||
790 | int result; | ||
791 | u64 v1 = 0; | ||
792 | |||
793 | result = read_node(PS3_LPAR_ID_CURRENT, | ||
794 | make_first_field("highmem", 0), | ||
795 | make_field("region", 0), | ||
796 | make_field("count", 0), | ||
797 | 0, | ||
798 | &v1, NULL); | ||
799 | *region_count = v1; | ||
800 | return result; | ||
801 | } | ||
802 | |||
803 | |||
804 | int ps3_repository_read_highmem_base(unsigned int region_index, | ||
805 | u64 *highmem_base) | ||
806 | { | ||
807 | return read_node(PS3_LPAR_ID_CURRENT, | ||
808 | make_first_field("highmem", 0), | ||
809 | make_field("region", region_index), | ||
810 | make_field("base", 0), | ||
811 | 0, | ||
812 | highmem_base, NULL); | ||
813 | } | ||
814 | |||
815 | int ps3_repository_read_highmem_size(unsigned int region_index, | ||
816 | u64 *highmem_size) | ||
817 | { | ||
818 | return read_node(PS3_LPAR_ID_CURRENT, | ||
819 | make_first_field("highmem", 0), | ||
820 | make_field("region", region_index), | ||
821 | make_field("size", 0), | ||
822 | 0, | ||
823 | highmem_size, NULL); | ||
824 | } | ||
825 | |||
826 | /** | ||
827 | * ps3_repository_read_highmem_info - Read high memory region info | ||
828 | * @region_index: Region index, {0,..,region_count-1}. | ||
829 | * @highmem_base: High memory base address. | ||
830 | * @highmem_size: High memory size. | ||
831 | * | ||
832 | * Bootloaders that preallocate highmem regions must place the | ||
833 | * region info into the repository at these well known nodes. | ||
834 | */ | ||
835 | |||
836 | int ps3_repository_read_highmem_info(unsigned int region_index, | ||
837 | u64 *highmem_base, u64 *highmem_size) | ||
838 | { | ||
839 | int result; | ||
840 | |||
841 | *highmem_base = 0; | ||
842 | result = ps3_repository_read_highmem_base(region_index, highmem_base); | ||
843 | return result ? result | ||
844 | : ps3_repository_read_highmem_size(region_index, highmem_size); | ||
845 | } | ||
846 | |||
847 | /** | ||
782 | * ps3_repository_read_num_spu_reserved - Number of physical spus reserved. | 848 | * ps3_repository_read_num_spu_reserved - Number of physical spus reserved. |
783 | * @num_spu: Number of physical spus. | 849 | * @num_spu: Number of physical spus. |
784 | */ | 850 | */ |