Commit 4cc0e3b1 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: put machine type into naca from Don Reed

parent f105d55b
......@@ -220,10 +220,6 @@ struct ItVpdAreas itVpdAreas = {
}
};
/* Data area used in flush_hash_page */
long long flush_hash_page_hpte[2];
struct msChunks msChunks = {0, 0, 0, 0, NULL};
/* Depending on whether this is called from iSeries or pSeries setup
......
......@@ -251,7 +251,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
#endif /* CONFIG_BLK_DEV_INITRD */
#endif
ppc_md.ppc_machine = _machine;
ppc_md.ppc_machine = naca->platform;
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.setup_residual = NULL;
......@@ -315,7 +315,7 @@ chrp_progress(char *s, unsigned short hex)
if (hex)
udbg_printf("<chrp_progress> %s\n", s);
if (!rtas.base || (_machine != _MACH_pSeries))
if (!rtas.base || (naca->platform != PLATFORM_PSERIES))
return;
if (max_width == 0) {
......
......@@ -121,7 +121,7 @@ void eeh_init(void) {
ibm_set_eeh_option = rtas_token("ibm,set-eeh-option");
ibm_set_slot_reset = rtas_token("ibm,set-slot-reset");
ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
if (ibm_set_eeh_option != RTAS_UNKNOWN_SERVICE && _machine == _MACH_pSeriesLP)
if (ibm_set_eeh_option != RTAS_UNKNOWN_SERVICE && naca->platform == PLATFORM_PSERIES_LPAR)
eeh_implemented = 1;
if (eeh_force_off > eeh_force_on) {
......
......@@ -83,7 +83,7 @@ create_pte_mapping(unsigned long start, unsigned long end,
for (addr = start; addr < end; addr += step) {
unsigned long vsid = get_kernel_vsid(addr);
unsigned long va = (vsid << 28) | (addr & 0xfffffff);
if (_machine == _MACH_pSeriesLP)
if (naca->platform == PLATFORM_PSERIES_LPAR)
pSeries_lpar_make_pte(htab, va,
(unsigned long)__v2a(addr), mode, mask, large);
else
......@@ -118,7 +118,7 @@ htab_initialize(void)
_htab_data->htab_num_ptegs = pteg_count;
_htab_data->htab_hash_mask = pteg_count - 1;
if (_machine == _MACH_pSeries) {
if (naca->platform == PLATFORM_PSERIES) {
/* Find storage for the HPT. Must be contiguous in
* the absolute address space.
*/
......
......@@ -518,7 +518,7 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
phb = pci_alloc_pci_controller("PHB SW",phb_type_speedwagon);
if (phb == NULL) return NULL;
if (_machine == _MACH_pSeries) {
if (naca->platform == PLATFORM_PSERIES) {
phb->cfg_addr = (volatile unsigned long *)
ioremap(reg_struct.address + 0x140, PAGE_SIZE);
phb->cfg_data = (char*)(phb->cfg_addr - 0x02); /* minus is correct */
......
......@@ -137,7 +137,7 @@ static inline struct TceTable *get_tce_table(struct pci_dev *dev)
dev = ppc64_isabridge_dev;
if (!dev)
return NULL;
if ( ( _machine == _MACH_iSeries ) && ( dev->bus ) )
if ( ( naca->platform == PLATFORM_ISERIES_LPAR ) && ( dev->bus ) )
return tceTables[dev->bus->number];
/* On the iSeries, the virtual bus will take this path. There is a */
/* fake pci_dev and dev_node built and used. */
......@@ -765,7 +765,7 @@ void create_tce_tables(void) {
struct pci_dev *dev;
struct device_node *dn, *mydn;
if (_machine == _MACH_pSeriesLP)
if (naca->platform == PLATFORM_PSERIES_LPAR)
create_tce_tables_for_busesLP(&pci_root_buses);
else
create_tce_tables_for_buses(&pci_root_buses);
......@@ -799,7 +799,7 @@ void create_pci_bus_tce_table( unsigned long token ) {
newTceTable = kmalloc( sizeof(struct TceTable), GFP_KERNEL );
if(_machine == _MACH_iSeries) {
if(naca->platform == PLATFORM_ISERIES_LPAR) {
if ( token > 254 ) {
printk("PCI: Bus TCE table failed, invalid bus number %lu\n", token );
return;
......@@ -860,7 +860,7 @@ void create_pci_bus_tce_table( unsigned long token ) {
dn = (struct device_node *)token;
phb = dn->phb;
if (_machine == _MACH_pSeries)
if (naca->platform == PLATFORM_PSERIES)
getTceTableParmsPSeries(phb, dn, newTceTable);
else
getTceTableParmsPSeriesLP(phb, dn, newTceTable);
......
......@@ -14,7 +14,6 @@
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/nvram.h>
#include <linux/spinlock.h>
#include <linux/console.h>
#include <linux/irq.h>
......@@ -225,9 +224,6 @@ EXPORT_SYMBOL(__no_use_cli);
#endif
#endif
#ifndef CONFIG_MACH_SPECIFIC
EXPORT_SYMBOL(_machine);
#endif
EXPORT_SYMBOL(ppc_md);
EXPORT_SYMBOL(find_devices);
......
......@@ -376,7 +376,7 @@ prom_initialize_naca(unsigned long mem)
_naca->iCacheL1LogLineSize = __ilog2(size);
_naca->iCacheL1LinesPerPage = PAGE_SIZE / size;
if (RELOC(_machine) == _MACH_pSeriesLP) {
if (_naca->platform == PLATFORM_PSERIES_LPAR) {
u32 pft_size[2];
call_prom(RELOC("getprop"), 4, 1, node,
RELOC("ibm,pft-size"),
......@@ -451,7 +451,7 @@ prom_initialize_naca(unsigned long mem)
_naca->physicalMemorySize = lmb_phys_mem_size();
if (RELOC(_machine) == _MACH_pSeries) {
if (_naca->platform == PLATFORM_PSERIES) {
unsigned long rnd_mem_size, pteg_count;
/* round mem_size up to next power of 2 */
......@@ -522,8 +522,8 @@ prom_initialize_naca(unsigned long mem)
prom_print_hex(_naca->interrupt_controller);
prom_print_nl();
prom_print(RELOC("_machine = 0x"));
prom_print_hex(RELOC(_machine));
prom_print(RELOC("naca->platform = 0x"));
prom_print_hex(_naca->platform);
prom_print_nl();
prom_print(RELOC("prom_initialize_naca: end...\n"));
......@@ -626,6 +626,7 @@ prom_instantiate_rtas(unsigned long mem)
unsigned long offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom);
struct rtas_t *_rtas = PTRRELOC(&rtas);
struct naca_struct *_naca = RELOC(naca);
ihandle prom_rtas;
u32 getprop_rval;
......@@ -642,7 +643,7 @@ prom_instantiate_rtas(unsigned long mem)
RELOC("ibm,hypertas-functions"),
hypertas_funcs,
sizeof(hypertas_funcs))) > 0) {
RELOC(_machine) = _MACH_pSeriesLP;
_naca->platform = PLATFORM_PSERIES_LPAR;
}
call_prom(RELOC("getprop"),
......@@ -1241,7 +1242,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
struct prom_t *_prom = PTRRELOC(&prom);
/* Default machine type. */
RELOC(_machine) = _MACH_pSeries;
_naca->platform = PLATFORM_PSERIES;
/* Reset klimit to take into account the embedded system map */
if (RELOC(embedded_sysmap_end))
RELOC(klimit) = __va(PAGE_ALIGN(RELOC(embedded_sysmap_end)));
......@@ -1413,7 +1414,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
lmb_reserve(0, __pa(RELOC(klimit)));
if (RELOC(_machine) == _MACH_pSeries)
if (_naca->platform == PLATFORM_PSERIES)
prom_initialize_tce_table();
if ((long) call_prom(RELOC("getprop"), 4, 1,
......
......@@ -200,7 +200,7 @@ void proc_rtas_init(void)
struct proc_dir_entry *entry;
rtas_node = find_devices("rtas");
if ((rtas_node == 0) || (_machine == _MACH_iSeries)) {
if ((rtas_node == 0) || (naca->platform == PLATFORM_ISERIES_LPAR)) {
return;
}
......
......@@ -76,8 +76,6 @@ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7);
int parse_bootinfo(void);
int _machine = _MACH_unknown;
#ifdef CONFIG_MAGIC_SYSRQ
unsigned long SYSRQ_KEY;
#endif /* CONFIG_MAGIC_SYSRQ */
......@@ -134,14 +132,15 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
/* pSeries systems are identified in prom.c via OF. */
if ( itLpNaca.xLparInstalled == 1 )
_machine = _MACH_iSeries;
switch (_machine) {
case _MACH_iSeries:
naca->platform = PLATFORM_ISERIES_LPAR;
switch (naca->platform) {
case PLATFORM_ISERIES_LPAR:
iSeries_init_early();
break;
#ifdef CONFIG_PPC_PSERIES
case _MACH_pSeries:
case PLATFORM_PSERIES:
pSeries_init_early();
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = initrd_end = 0;
......@@ -149,7 +148,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
parse_bootinfo();
break;
case _MACH_pSeriesLP:
case PLATFORM_PSERIES_LPAR:
pSeriesLP_init_early();
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = initrd_end = 0;
......@@ -220,15 +219,15 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
udbg_puts("\n-----------------------------------------------------\n");
if ( _machine & _MACH_pSeries ) {
if (naca->platform & PLATFORM_PSERIES) {
finish_device_tree();
chrp_init(r3, r4, r5, r6, r7);
}
mm_init_ppc64();
switch (_machine) {
case _MACH_iSeries:
switch (naca->platform) {
case PLATFORM_ISERIES_LPAR:
iSeries_init();
break;
default:
......@@ -313,7 +312,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
* Assume here that all clock rates are the same in a
* smp system. -- Cort
*/
if (_machine != _MACH_iSeries) {
if (naca->platform != PLATFORM_ISERIES_LPAR) {
struct device_node *cpu_node;
int *fp;
......
......@@ -262,7 +262,7 @@ smp_chrp_setup_cpu(int cpu_nr)
static atomic_t ready = ATOMIC_INIT(1);
static volatile int frozen = 0;
if (_machine == _MACH_pSeriesLP) {
if (naca->platform == PLATFORM_PSERIES_LPAR) {
/* timebases already synced under the hypervisor. */
paca[cpu_nr].next_jiffy_update_tb = tb_last_stamp = get_tb();
if (cpu_nr == 0) {
......
......@@ -23,8 +23,6 @@
#include <asm/uaccess.h>
#include <asm/machdep.h>
extern int _machine;
struct NS16550 {
/* this struct must be packed */
unsigned char rbr; /* 0 */
......@@ -86,7 +84,7 @@ udbg_putc(unsigned char c)
/* wait for idle */;
udbg_comport->thr = '\r'; eieio();
}
} else if ( _machine == _MACH_iSeries ) {
} else if (naca->platform == PLATFORM_ISERIES_LPAR) {
/* ToDo: switch this via ppc_md */
printk("%c", c);
}
......@@ -180,7 +178,7 @@ udbg_puthex(unsigned long val)
void
udbg_printSP(const char *s)
{
if (_machine == _MACH_pSeries) {
if (naca->platform == PLATFORM_PSERIES) {
unsigned long sp;
asm("mr %0,1" : "=r" (sp) :);
if (s)
......
......@@ -369,7 +369,7 @@ xics_init_IRQ( void )
xics_irq_8259_cascade = virt_irq_create_mapping(xics_irq_8259_cascade_real);
}
if (_machine == _MACH_pSeries) {
if (naca->platform == PLATFORM_PSERIES) {
#ifdef CONFIG_SMP
for (i = 0; i < naca->processorCount; ++i) {
xics_info.per_cpu[i] =
......@@ -383,7 +383,7 @@ xics_init_IRQ( void )
/* actually iSeries does not use any of xics...but it has link dependencies
* for now, except this new one...
*/
} else if (_machine == _MACH_pSeriesLP) {
} else if (naca->platform == PLATFORM_PSERIES_LPAR) {
ops = &pSeriesLP_ops;
#endif
}
......
......@@ -538,7 +538,7 @@ insert_bpts()
int i;
struct bpt *bp;
if (_machine != _MACH_pSeries)
if (naca->platform != PLATFORM_PSERIES)
return;
bp = bpts;
for (i = 0; i < NBPTS; ++i, ++bp) {
......@@ -569,7 +569,7 @@ remove_bpts()
struct bpt *bp;
unsigned instr;
if (_machine != _MACH_pSeries)
if (naca->platform != PLATFORM_PSERIES)
return;
if (!__is_processor(PV_POWER4)) {
set_dabr(0);
......
......@@ -52,7 +52,7 @@ struct HvReleaseData
u32 xDesc; // Descriptor "HvRD" ebcdic x00-x03
u16 xSize; // Size of this control block x04-x05
u16 xVpdAreasPtrOffset; // Offset in NACA of ItVpdAreas x06-x07
struct naca* xSlicNacaAddr; // Virtual address of SLIC NACA x08-x0F
struct naca_struct * xSlicNacaAddr; // Virt addr of SLIC NACA x08-x0F
u32 xMsNucDataOffset; // Offset of Linux Mapping Data x10-x13
u32 xRsvd1; // Reserved x14-x17
u16 xTagsMode:1; // 0 == tags active, 1 == tags inactive
......
......@@ -30,7 +30,9 @@ struct naca_struct {
u64 pftSize; /* Log base 2 of page table size */
u64 serialPortAddr; /* Phyical address of serial port */
u8 interrupt_controller; /* Type of interrupt controller */
u8 resv0[6]; /* Padding */
u8 resv0; /* Type of interrupt controller */
u16 platform; /* Platform flags */
u8 resv1[12]; /* Padding */
};
extern struct naca_struct *naca;
......
......@@ -490,18 +490,10 @@
#define PV_630 0x0040
#define PV_630p 0x0041
/* Platforms supported by PPC64. _machine is actually a set of flags */
#define _MACH_pSeriesHW 0x00010000
#define _MACH_iSeriesHW 0x00020000
#define _MACH_LPAR 0x00000001
#define _MACH_unknown 0x00000000
#define _MACH_pSeries (_MACH_pSeriesHW)
#define _MACH_pSeriesLP (_MACH_pSeriesHW | _MACH_LPAR)
#define _MACH_iSeries (_MACH_iSeriesHW | _MACH_LPAR)
/* Compat defines for drivers */
#define _MACH_Pmac 0xf0000000 /* bogus value */
/* Platforms supported by PPC64 */
#define PLATFORM_PSERIES 0x0100
#define PLATFORM_PSERIES_LPAR 0x0101
#define PLATFORM_ISERIES_LPAR 0x0201
/*
* List of interrupt controllers.
......@@ -609,7 +601,6 @@ GLUE(GLUE(.LT,NAME),_procname_end):
asm volatile("mfasr %0" : "=r" (rval)); rval;})
#ifndef __ASSEMBLY__
extern int _machine;
extern int have_of;
struct task_struct;
......
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