diff options
| author | Anton Blanchard <anton@samba.org> | 2002-04-24 10:01:44 +1000 |
|---|---|---|
| committer | Anton Blanchard <anton@samba.org> | 2002-04-24 10:01:44 +1000 |
| commit | 4cc0e3b1097044b0f0fbbe284ac9ce0a8eee8df7 (patch) | |
| tree | 272f48f680fce084fb89a999ac957bd6407e141e | |
| parent | f105d55bba35aaf81d1f1870a8479f40ff5f1c48 (diff) | |
ppc64: put machine type into naca from Don Reed
| -rw-r--r-- | arch/ppc64/kernel/LparData.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/kernel/chrp_setup.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/kernel/eeh.c | 2 | ||||
| -rw-r--r-- | arch/ppc64/kernel/htab.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/kernel/pSeries_pci.c | 2 | ||||
| -rw-r--r-- | arch/ppc64/kernel/pci_dma.c | 8 | ||||
| -rw-r--r-- | arch/ppc64/kernel/ppc_ksyms.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/kernel/prom.c | 15 | ||||
| -rw-r--r-- | arch/ppc64/kernel/rtas-proc.c | 2 | ||||
| -rw-r--r-- | arch/ppc64/kernel/setup.c | 21 | ||||
| -rw-r--r-- | arch/ppc64/kernel/smp.c | 2 | ||||
| -rw-r--r-- | arch/ppc64/kernel/udbg.c | 6 | ||||
| -rw-r--r-- | arch/ppc64/kernel/xics.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/xmon/xmon.c | 4 | ||||
| -rw-r--r-- | include/asm-ppc64/iSeries/HvReleaseData.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc64/naca.h | 4 | ||||
| -rw-r--r-- | include/asm-ppc64/processor.h | 17 |
17 files changed, 44 insertions, 61 deletions
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c index 7867cc31a91f..a2ccde92c291 100644 --- a/arch/ppc64/kernel/LparData.c +++ b/arch/ppc64/kernel/LparData.c @@ -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 diff --git a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c index ed2420799d6a..5ab6e7db8248 100644 --- a/arch/ppc64/kernel/chrp_setup.c +++ b/arch/ppc64/kernel/chrp_setup.c @@ -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) { diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c index 1c6da4221aed..8748732390be 100644 --- a/arch/ppc64/kernel/eeh.c +++ b/arch/ppc64/kernel/eeh.c @@ -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) { diff --git a/arch/ppc64/kernel/htab.c b/arch/ppc64/kernel/htab.c index 9ff64fd45f26..c0736c5033fd 100644 --- a/arch/ppc64/kernel/htab.c +++ b/arch/ppc64/kernel/htab.c @@ -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. */ diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c index 894f93519391..649cd09daece 100644 --- a/arch/ppc64/kernel/pSeries_pci.c +++ b/arch/ppc64/kernel/pSeries_pci.c @@ -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 */ diff --git a/arch/ppc64/kernel/pci_dma.c b/arch/ppc64/kernel/pci_dma.c index b0fd9177e0e5..7422a4c617d1 100644 --- a/arch/ppc64/kernel/pci_dma.c +++ b/arch/ppc64/kernel/pci_dma.c @@ -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); diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c index 22e029bca6e8..a4fbda192927 100644 --- a/arch/ppc64/kernel/ppc_ksyms.c +++ b/arch/ppc64/kernel/ppc_ksyms.c @@ -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); diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index 29857f66fe31..6aaaccea986a 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c @@ -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, diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c index 6b444dd5ee98..05377970c47a 100644 --- a/arch/ppc64/kernel/rtas-proc.c +++ b/arch/ppc64/kernel/rtas-proc.c @@ -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; } diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 9a66e7da473a..5d66d38c4cb1 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c @@ -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; diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index db359b924292..350ecc129d12 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c @@ -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) { diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c index c7df5546a58b..7d852fdae4bf 100644 --- a/arch/ppc64/kernel/udbg.c +++ b/arch/ppc64/kernel/udbg.c @@ -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) diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index d49f425d5253..be8a9772e6d4 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c @@ -369,7 +369,7 @@ nextnode: 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 @@ nextnode: /* 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 } diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index fcebbc3533f5..ca788bfea8e9 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c @@ -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); diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h index edb00aa70064..f986b182cffa 100644 --- a/include/asm-ppc64/iSeries/HvReleaseData.h +++ b/include/asm-ppc64/iSeries/HvReleaseData.h @@ -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 diff --git a/include/asm-ppc64/naca.h b/include/asm-ppc64/naca.h index bc790dfffb77..ed28065ae2a7 100644 --- a/include/asm-ppc64/naca.h +++ b/include/asm-ppc64/naca.h @@ -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; diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 9cb21765a7ac..e05ad20fae15 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -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; |
