Commit a7872552 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: add dabr and iabr cpu features

parent 8daa7029
...@@ -37,7 +37,8 @@ extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec); ...@@ -37,7 +37,8 @@ extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
struct cpu_spec cpu_specs[] = { struct cpu_spec cpu_specs[] = {
{ /* Power3 */ { /* Power3 */
0xffff0000, 0x00400000, "Power3 (630)", 0xffff0000, 0x00400000, "Power3 (630)",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -45,7 +46,8 @@ struct cpu_spec cpu_specs[] = { ...@@ -45,7 +46,8 @@ struct cpu_spec cpu_specs[] = {
}, },
{ /* Power3+ */ { /* Power3+ */
0xffff0000, 0x00410000, "Power3 (630+)", 0xffff0000, 0x00410000, "Power3 (630+)",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -53,7 +55,8 @@ struct cpu_spec cpu_specs[] = { ...@@ -53,7 +55,8 @@ struct cpu_spec cpu_specs[] = {
}, },
{ /* Northstar */ { /* Northstar */
0xffff0000, 0x00330000, "Northstar", 0xffff0000, 0x00330000, "Northstar",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -61,7 +64,8 @@ struct cpu_spec cpu_specs[] = { ...@@ -61,7 +64,8 @@ struct cpu_spec cpu_specs[] = {
}, },
{ /* Pulsar */ { /* Pulsar */
0xffff0000, 0x00340000, "Pulsar", 0xffff0000, 0x00340000, "Pulsar",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -69,7 +73,8 @@ struct cpu_spec cpu_specs[] = { ...@@ -69,7 +73,8 @@ struct cpu_spec cpu_specs[] = {
}, },
{ /* I-star */ { /* I-star */
0xffff0000, 0x00360000, "I-star", 0xffff0000, 0x00360000, "I-star",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -77,7 +82,8 @@ struct cpu_spec cpu_specs[] = { ...@@ -77,7 +82,8 @@ struct cpu_spec cpu_specs[] = {
}, },
{ /* S-star */ { /* S-star */
0xffff0000, 0x00370000, "S-star", 0xffff0000, 0x00370000, "S-star",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_DABR | CPU_FTR_IABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power3, __setup_cpu_power3,
...@@ -86,7 +92,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -86,7 +92,7 @@ struct cpu_spec cpu_specs[] = {
{ /* Power4 */ { /* Power4 */
0xffff0000, 0x00350000, "Power4", 0xffff0000, 0x00350000, "Power4",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_PPCAS_ARCH_V2, CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_DABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power4, __setup_cpu_power4,
...@@ -95,7 +101,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -95,7 +101,7 @@ struct cpu_spec cpu_specs[] = {
{ /* Power4+ */ { /* Power4+ */
0xffff0000, 0x00380000, "Power4+", 0xffff0000, 0x00380000, "Power4+",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_PPCAS_ARCH_V2, CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_DABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power4, __setup_cpu_power4,
...@@ -104,7 +110,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -104,7 +110,7 @@ struct cpu_spec cpu_specs[] = {
{ /* default match */ { /* default match */
0x00000000, 0x00000000, "(Power4-Compatible)", 0x00000000, 0x00000000, "(Power4-Compatible)",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
CPU_FTR_PPCAS_ARCH_V2, CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_DABR,
COMMON_USER_PPC64, COMMON_USER_PPC64,
128, 128, 128, 128,
__setup_cpu_power4, __setup_cpu_power4,
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <asm/naca.h> #include <asm/naca.h>
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/cputable.h>
#include "nonstdio.h" #include "nonstdio.h"
#include "privinst.h" #include "privinst.h"
...@@ -469,9 +470,9 @@ insert_bpts() ...@@ -469,9 +470,9 @@ insert_bpts()
} }
} }
if (cpu_has_dabr() && dabr.enabled) if ((cur_cpu_spec->cpu_features & CPU_FTR_DABR) && dabr.enabled)
set_dabr(dabr.address); set_dabr(dabr.address);
if (cpu_has_iabr() && iabr.enabled) if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR) && iabr.enabled)
set_iabr(iabr.address); set_iabr(iabr.address);
} }
...@@ -485,9 +486,9 @@ remove_bpts() ...@@ -485,9 +486,9 @@ remove_bpts()
if (systemcfg->platform != PLATFORM_PSERIES) if (systemcfg->platform != PLATFORM_PSERIES)
return; return;
if (cpu_has_dabr()) if ((cur_cpu_spec->cpu_features & CPU_FTR_DABR))
set_dabr(0); set_dabr(0);
if (cpu_has_iabr()) if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR))
set_iabr(0); set_iabr(0);
bp = bpts; bp = bpts;
...@@ -777,7 +778,7 @@ bpt_cmds(void) ...@@ -777,7 +778,7 @@ bpt_cmds(void)
cmd = inchar(); cmd = inchar();
switch (cmd) { switch (cmd) {
case 'd': /* bd - hardware data breakpoint */ case 'd': /* bd - hardware data breakpoint */
if (cpu_has_dabr()) { if (!(cur_cpu_spec->cpu_features & CPU_FTR_DABR)) {
printf("Not implemented on this cpu\n"); printf("Not implemented on this cpu\n");
break; break;
} }
...@@ -797,7 +798,7 @@ bpt_cmds(void) ...@@ -797,7 +798,7 @@ bpt_cmds(void)
dabr.address = (dabr.address & ~7) | mode; dabr.address = (dabr.address & ~7) | mode;
break; break;
case 'i': /* bi - hardware instr breakpoint */ case 'i': /* bi - hardware instr breakpoint */
if (cpu_has_iabr()) { if (!(cur_cpu_spec->cpu_features & CPU_FTR_IABR)) {
printf("Not implemented on POWER4\n"); printf("Not implemented on POWER4\n");
break; break;
} }
......
...@@ -113,6 +113,8 @@ extern firmware_feature_t firmware_features_table[]; ...@@ -113,6 +113,8 @@ extern firmware_feature_t firmware_features_table[];
#define CPU_FTR_TLBIEL 0x0000000400000000 #define CPU_FTR_TLBIEL 0x0000000400000000
#define CPU_FTR_NOEXECUTE 0x0000000800000000 #define CPU_FTR_NOEXECUTE 0x0000000800000000
#define CPU_FTR_NODSISRALIGN 0x0000001000000000 #define CPU_FTR_NODSISRALIGN 0x0000001000000000
#define CPU_FTR_DABR 0x0000002000000000
#define CPU_FTR_IABR 0x0000004000000000
/* Platform firmware features */ /* Platform firmware features */
#define FW_FTR_ 0x0000000000000001 #define FW_FTR_ 0x0000000000000001
......
...@@ -730,15 +730,6 @@ static inline void prefetchw(const void *x) ...@@ -730,15 +730,6 @@ static inline void prefetchw(const void *x)
#define spin_lock_prefetch(x) prefetchw(x) #define spin_lock_prefetch(x) prefetchw(x)
/* XXX we have to call HV to set when in LPAR */
#define cpu_has_dabr() (1)
#define cpu_has_iabr() (processor_type() != PV_POWER4 && \
processor_type() != PV_POWER4p)
#define cpu_alignexc_sets_dsisr() (processor_type() != PV_POWER4 && \
processor_type() != PV_POWER4p)
#endif /* ASSEMBLY */ #endif /* ASSEMBLY */
#endif /* __ASM_PPC64_PROCESSOR_H */ #endif /* __ASM_PPC64_PROCESSOR_H */
...@@ -115,13 +115,6 @@ static inline int __is_processor(unsigned long pv) ...@@ -115,13 +115,6 @@ static inline int __is_processor(unsigned long pv)
return(PVR_VER(pvr) == pv); return(PVR_VER(pvr) == pv);
} }
static inline int processor_type(void)
{
unsigned long pvr;
asm ("mfspr %0, 0x11F" : "=r" (pvr));
return(PVR_VER(pvr));
}
/* /*
* Atomic exchange * Atomic exchange
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment