@@ -74,7 +74,7 @@ static int find_free_bat(void)
7474{
7575 int b ;
7676
77- if (cpu_has_feature ( CPU_FTR_601 )) {
77+ if (IS_ENABLED ( CONFIG_PPC_BOOK3S_601 )) {
7878 for (b = 0 ; b < 4 ; b ++ ) {
7979 struct ppc_bat * bat = BATS [b ];
8080
@@ -106,7 +106,7 @@ static int find_free_bat(void)
106106 */
107107static unsigned int block_size (unsigned long base , unsigned long top )
108108{
109- unsigned int max_size = ( cpu_has_feature ( CPU_FTR_601 ) ? 8 : 256 ) << 20 ;
109+ unsigned int max_size = IS_ENABLED ( CONFIG_PPC_BOOK3S_601 ) ? SZ_8M : SZ_256M ;
110110 unsigned int base_shift = (ffs (base ) - 1 ) & 31 ;
111111 unsigned int block_shift = (fls (top - base ) - 1 ) & 31 ;
112112
@@ -189,7 +189,7 @@ void mmu_mark_initmem_nx(void)
189189 unsigned long top = (unsigned long )_etext - PAGE_OFFSET ;
190190 unsigned long size ;
191191
192- if (cpu_has_feature ( CPU_FTR_601 ))
192+ if (IS_ENABLED ( CONFIG_PPC_BOOK3S_601 ))
193193 return ;
194194
195195 for (i = 0 ; i < nb - 1 && base < top && top - base > (128 << 10 );) {
@@ -227,7 +227,7 @@ void mmu_mark_rodata_ro(void)
227227 int nb = mmu_has_feature (MMU_FTR_USE_HIGH_BATS ) ? 8 : 4 ;
228228 int i ;
229229
230- if (cpu_has_feature ( CPU_FTR_601 ))
230+ if (IS_ENABLED ( CONFIG_PPC_BOOK3S_601 ))
231231 return ;
232232
233233 for (i = 0 ; i < nb ; i ++ ) {
@@ -259,7 +259,7 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
259259 flags &= ~_PAGE_COHERENT ;
260260
261261 bl = (size >> 17 ) - 1 ;
262- if (PVR_VER ( mfspr ( SPRN_PVR )) != 1 ) {
262+ if (! IS_ENABLED ( CONFIG_PPC_BOOK3S_601 ) ) {
263263 /* 603, 604, etc. */
264264 /* Do DBAT first */
265265 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
@@ -441,7 +441,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
441441 BUG_ON (first_memblock_base != 0 );
442442
443443 /* 601 can only access 16MB at the moment */
444- if (PVR_VER ( mfspr ( SPRN_PVR )) == 1 )
444+ if (IS_ENABLED ( CONFIG_PPC_BOOK3S_601 ) )
445445 memblock_set_current_limit (min_t (u64 , first_memblock_size , 0x01000000 ));
446446 else /* Anything else has 256M mapped */
447447 memblock_set_current_limit (min_t (u64 , first_memblock_size , 0x10000000 ));
@@ -459,9 +459,6 @@ void __init setup_kuep(bool disabled)
459459{
460460 pr_info ("Activating Kernel Userspace Execution Prevention\n" );
461461
462- if (cpu_has_feature (CPU_FTR_601 ))
463- pr_warn ("KUEP is not working on powerpc 601 (No NX bit in Seg Regs)\n" );
464-
465462 if (disabled )
466463 pr_warn ("KUEP cannot be disabled yet on 6xx when compiled in\n" );
467464}
0 commit comments