Skip to content

Commit

Permalink
powerpc: Remove FW_FEATURE ISERIES from arch code
Browse files Browse the repository at this point in the history
This is no longer selectable, so just remove all the dependent code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Stephen Rothwell authored and Benjamin Herrenschmidt committed Mar 21, 2012
1 parent ec86b45 commit f533927
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 367 deletions.
21 changes: 1 addition & 20 deletions arch/powerpc/include/asm/abs_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <asm/types.h>
#include <asm/page.h>
#include <asm/prom.h>
#include <asm/firmware.h>

struct mschunks_map {
unsigned long num_chunks;
Expand Down Expand Up @@ -46,30 +45,12 @@ static inline unsigned long addr_to_chunk(unsigned long addr)

static inline unsigned long phys_to_abs(unsigned long pa)
{
unsigned long chunk;

/* This is a no-op on non-iSeries */
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return pa;

chunk = addr_to_chunk(pa);

if (chunk < mschunks_map.num_chunks)
chunk = mschunks_map.mapping[chunk];

return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK);
return pa;
}

/* Convenience macros */
#define virt_to_abs(va) phys_to_abs(__pa(va))
#define abs_to_virt(aa) __va(aa)

/*
* Converts Virtual Address to Real Address for
* Legacy iSeries Hypervisor calls
*/
#define iseries_hv_addr(virtaddr) \
(0x8000000000000000UL | virt_to_abs(virtaddr))

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ABS_ADDR_H */
9 changes: 0 additions & 9 deletions arch/powerpc/include/asm/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#define FW_FEATURE_XDABR ASM_CONST(0x0000000000040000)
#define FW_FEATURE_MULTITCE ASM_CONST(0x0000000000080000)
#define FW_FEATURE_SPLPAR ASM_CONST(0x0000000000100000)
#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000)
#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000)
Expand All @@ -65,8 +64,6 @@ enum {
FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO,
FW_FEATURE_PSERIES_ALWAYS = 0,
FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,
FW_FEATURE_POWERNV_ALWAYS = 0,
FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
Expand All @@ -79,9 +76,6 @@ enum {
#ifdef CONFIG_PPC_PSERIES
FW_FEATURE_PSERIES_POSSIBLE |
#endif
#ifdef CONFIG_PPC_ISERIES
FW_FEATURE_ISERIES_POSSIBLE |
#endif
#ifdef CONFIG_PPC_POWERNV
FW_FEATURE_POWERNV_POSSIBLE |
#endif
Expand All @@ -99,9 +93,6 @@ enum {
#ifdef CONFIG_PPC_PSERIES
FW_FEATURE_PSERIES_ALWAYS &
#endif
#ifdef CONFIG_PPC_ISERIES
FW_FEATURE_ISERIES_ALWAYS &
#endif
#ifdef CONFIG_PPC_POWERNV
FW_FEATURE_POWERNV_ALWAYS &
#endif
Expand Down
15 changes: 0 additions & 15 deletions arch/powerpc/include/asm/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#include <linux/percpu.h>

#include <asm/processor.h>
#ifdef CONFIG_PPC_ISERIES
#include <asm/paca.h>
#include <asm/firmware.h>
#include <asm/iseries/hv_call.h>
#endif

/* time.c */
extern unsigned long tb_ticks_per_jiffy;
Expand Down Expand Up @@ -166,15 +161,6 @@ static inline void set_dec(int val)
#else
#ifndef CONFIG_BOOKE
--val;
#endif
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) &&
get_lppaca()->shared_proc) {
get_lppaca()->virtual_decr = val;
if (get_dec() > val)
HvCall_setVirtualDecr();
return;
}
#endif
mtspr(SPRN_DEC, val);
#endif /* not 40x or 8xx_CPU6 */
Expand Down Expand Up @@ -217,7 +203,6 @@ DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
#endif

extern void secondary_cpu_time_init(void);
extern void iSeries_time_init_early(void);

DECLARE_PER_CPU(u64, decrementers_next_tb);

Expand Down
14 changes: 0 additions & 14 deletions arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ notrace void arch_local_irq_restore(unsigned long en)
* External interrupt events on non-iseries will have caused
* interrupts to be hard-disabled, so there is no problem, we
* cannot have preempted.
*
* That leaves us with EEs on iSeries or decrementer interrupts,
* which I decided to safely ignore. The preemption would have
* itself been the result of an interrupt, upon which return we
* will have checked for pending events on the old CPU.
*/
irq_happened = get_irq_happened();
if (!irq_happened)
Expand Down Expand Up @@ -458,15 +453,6 @@ void do_IRQ(struct pt_regs *regs)
irq_exit();
set_irq_regs(old_regs);

#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) &&
get_lppaca()->int_dword.fields.decr_int) {
get_lppaca()->int_dword.fields.decr_int = 0;
/* Signal a fake decrementer interrupt */
timer_interrupt(regs);
}
#endif

trace_irq_exit(regs);
}

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/kernel/isa-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <asm/pci-bridge.h>
#include <asm/machdep.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>

unsigned long isa_io_base; /* NULL if no ISA bus */
EXPORT_SYMBOL(isa_io_base);
Expand Down Expand Up @@ -261,8 +260,6 @@ static struct notifier_block isa_bridge_notifier = {
*/
static int __init isa_bridge_init(void)
{
if (firmware_has_feature(FW_FEATURE_ISERIES))
return 0;
bus_register_notifier(&pci_bus_type, &isa_bridge_notifier);
return 0;
}
Expand Down
108 changes: 7 additions & 101 deletions arch/powerpc/kernel/lparcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <asm/iseries/hv_lp_config.h>
#include <asm/lppaca.h>
#include <asm/hvcall.h>
#include <asm/firmware.h>
Expand Down Expand Up @@ -55,80 +54,14 @@ static unsigned long get_purr(void)
int cpu;

for_each_possible_cpu(cpu) {
if (firmware_has_feature(FW_FEATURE_ISERIES))
sum_purr += lppaca_of(cpu).emulated_time_base;
else {
struct cpu_usage *cu;
struct cpu_usage *cu;

cu = &per_cpu(cpu_usage_array, cpu);
sum_purr += cu->current_tb;
}
cu = &per_cpu(cpu_usage_array, cpu);
sum_purr += cu->current_tb;
}
return sum_purr;
}

#ifdef CONFIG_PPC_ISERIES

/*
* Methods used to fetch LPAR data when running on an iSeries platform.
*/
static int iseries_lparcfg_data(struct seq_file *m, void *v)
{
unsigned long pool_id;
int shared, entitled_capacity, max_entitled_capacity;
int processors, max_processors;
unsigned long purr = get_purr();

shared = (int)(local_paca->lppaca_ptr->shared_proc);

seq_printf(m, "system_active_processors=%d\n",
(int)HvLpConfig_getSystemPhysicalProcessors());

seq_printf(m, "system_potential_processors=%d\n",
(int)HvLpConfig_getSystemPhysicalProcessors());

processors = (int)HvLpConfig_getPhysicalProcessors();
seq_printf(m, "partition_active_processors=%d\n", processors);

max_processors = (int)HvLpConfig_getMaxPhysicalProcessors();
seq_printf(m, "partition_potential_processors=%d\n", max_processors);

if (shared) {
entitled_capacity = HvLpConfig_getSharedProcUnits();
max_entitled_capacity = HvLpConfig_getMaxSharedProcUnits();
} else {
entitled_capacity = processors * 100;
max_entitled_capacity = max_processors * 100;
}
seq_printf(m, "partition_entitled_capacity=%d\n", entitled_capacity);

seq_printf(m, "partition_max_entitled_capacity=%d\n",
max_entitled_capacity);

if (shared) {
pool_id = HvLpConfig_getSharedPoolIndex();
seq_printf(m, "pool=%d\n", (int)pool_id);
seq_printf(m, "pool_capacity=%d\n",
(int)(HvLpConfig_getNumProcsInSharedPool(pool_id) *
100));
seq_printf(m, "purr=%ld\n", purr);
}

seq_printf(m, "shared_processor_mode=%d\n", shared);

return 0;
}

#else /* CONFIG_PPC_ISERIES */

static int iseries_lparcfg_data(struct seq_file *m, void *v)
{
return 0;
}

#endif /* CONFIG_PPC_ISERIES */

#ifdef CONFIG_PPC_PSERIES
/*
* Methods used to fetch LPAR data when running on a pSeries platform.
*/
Expand Down Expand Up @@ -648,8 +581,7 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
u8 new_weight, *new_weight_ptr = &new_weight;
ssize_t retval;

if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
firmware_has_feature(FW_FEATURE_ISERIES))
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
return -EINVAL;

if (count > kbuf_sz)
Expand Down Expand Up @@ -709,21 +641,6 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
return retval;
}

#else /* CONFIG_PPC_PSERIES */

static int pseries_lparcfg_data(struct seq_file *m, void *v)
{
return 0;
}

static ssize_t lparcfg_write(struct file *file, const char __user * buf,
size_t count, loff_t * off)
{
return -EINVAL;
}

#endif /* CONFIG_PPC_PSERIES */

static int lparcfg_data(struct seq_file *m, void *v)
{
struct device_node *rootdn;
Expand All @@ -738,19 +655,11 @@ static int lparcfg_data(struct seq_file *m, void *v)
rootdn = of_find_node_by_path("/");
if (rootdn) {
tmp = of_get_property(rootdn, "model", NULL);
if (tmp) {
if (tmp)
model = tmp;
/* Skip "IBM," - see platforms/iseries/dt.c */
if (firmware_has_feature(FW_FEATURE_ISERIES))
model += 4;
}
tmp = of_get_property(rootdn, "system-id", NULL);
if (tmp) {
if (tmp)
system_id = tmp;
/* Skip "IBM," - see platforms/iseries/dt.c */
if (firmware_has_feature(FW_FEATURE_ISERIES))
system_id += 4;
}
lp_index_ptr = of_get_property(rootdn, "ibm,partition-no",
NULL);
if (lp_index_ptr)
Expand All @@ -761,8 +670,6 @@ static int lparcfg_data(struct seq_file *m, void *v)
seq_printf(m, "system_type=%s\n", model);
seq_printf(m, "partition_id=%d\n", (int)lp_index);

if (firmware_has_feature(FW_FEATURE_ISERIES))
return iseries_lparcfg_data(m, v);
return pseries_lparcfg_data(m, v);
}

Expand All @@ -786,8 +693,7 @@ static int __init lparcfg_init(void)
umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;

/* Allow writing if we have FW_FEATURE_SPLPAR */
if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
!firmware_has_feature(FW_FEATURE_ISERIES))
if (firmware_has_feature(FW_FEATURE_SPLPAR))
mode |= S_IWUSR;

ent = proc_create("powerpc/lparcfg", mode, NULL, &lparcfg_fops);
Expand Down
12 changes: 3 additions & 9 deletions arch/powerpc/kernel/paca.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
#include <linux/export.h>
#include <linux/memblock.h>

#include <asm/firmware.h>
#include <asm/lppaca.h>
#include <asm/paca.h>
#include <asm/sections.h>
#include <asm/pgtable.h>
#include <asm/iseries/lpar_map.h>
#include <asm/iseries/hv_types.h>
#include <asm/kexec.h>

/* This symbol is provided by the linker - let it fill in the paca
Expand All @@ -30,8 +27,8 @@ extern unsigned long __toc_start;
* The structure which the hypervisor knows about - this structure
* should not cross a page boundary. The vpa_init/register_vpa call
* is now known to fail if the lppaca structure crosses a page
* boundary. The lppaca is also used on legacy iSeries and POWER5
* pSeries boxes. The lppaca is 640 bytes long, and cannot readily
* boundary. The lppaca is also used on POWER5 pSeries boxes.
* The lppaca is 640 bytes long, and cannot readily
* change since the hypervisor knows its layout, so a 1kB alignment
* will suffice to ensure that it doesn't cross a page boundary.
*/
Expand Down Expand Up @@ -183,12 +180,9 @@ void __init allocate_pacas(void)
/*
* We can't take SLB misses on the paca, and we want to access them
* in real mode, so allocate them within the RMA and also within
* the first segment. On iSeries they must be within the area mapped
* by the HV, which is HvPagesToMap * HVPAGESIZE bytes.
* the first segment.
*/
limit = min(0x10000000ULL, ppc64_rma_size);
if (firmware_has_feature(FW_FEATURE_ISERIES))
limit = min(limit, HvPagesToMap * HVPAGESIZE);

paca_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpu_ids);

Expand Down
15 changes: 0 additions & 15 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <asm/byteorder.h>
#include <asm/machdep.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>
#include <asm/eeh.h>

static DEFINE_SPINLOCK(hose_spinlock);
Expand Down Expand Up @@ -219,20 +218,6 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
struct of_irq oirq;
unsigned int virq;

/* The current device-tree that iSeries generates from the HV
* PCI informations doesn't contain proper interrupt routing,
* and all the fallback would do is print out crap, so we
* don't attempt to resolve the interrupts here at all, some
* iSeries specific fixup does it.
*
* In the long run, we will hopefully fix the generated device-tree
* instead.
*/
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES))
return -1;
#endif

pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));

#ifdef DEBUG
Expand Down
Loading

0 comments on commit f533927

Please sign in to comment.