mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 16:01:14 +07:00
powerpc: Get 64-bit configs to compile with ARCH=powerpc
This is a bunch of mostly small fixes that are needed to get ARCH=powerpc to compile for 64-bit. This adds setup_64.c from arch/ppc64/kernel/setup.c and locks.c from arch/ppc64/lib/locks.c. Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
bc6f8a4b19
commit
40ef8cbc6d
@ -10,6 +10,12 @@ CFLAGS_prom_init.o += -fPIC
|
||||
CFLAGS_btext.o += -fPIC
|
||||
endif
|
||||
|
||||
obj-y := semaphore.o traps.o
|
||||
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
|
||||
obj-$(CONFIG_POWER4) += idle_power4.o
|
||||
|
||||
ifeq ($(CONFIG_PPC_MERGE),y)
|
||||
|
||||
extra-$(CONFIG_PPC_STD_MMU) := head_32.o
|
||||
extra-$(CONFIG_PPC64) := head_64.o
|
||||
extra-$(CONFIG_40x) := head_4xx.o
|
||||
@ -21,15 +27,12 @@ extra-$(CONFIG_PPC64) += entry_64.o
|
||||
extra-$(CONFIG_PPC_FPU) += fpu.o
|
||||
extra-y += vmlinux.lds
|
||||
|
||||
obj-y += traps.o prom.o semaphore.o
|
||||
obj-y += process.o init_task.o \
|
||||
prom.o systbl.o
|
||||
obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o
|
||||
obj-$(CONFIG_PPC64) += idle_power4.o
|
||||
obj-$(CONFIG_PPC64) += misc_64.o
|
||||
ifeq ($(CONFIG_PPC32),y)
|
||||
obj-$(CONFIG_PPC64) += setup_64.o misc_64.o
|
||||
obj-$(CONFIG_PPC_OF) += prom_init.o of_device.o
|
||||
obj-$(CONFIG_MODULES) += ppc_ksyms.o
|
||||
endif
|
||||
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
|
||||
obj-$(CONFIG_BOOTX_TEXT) += btext.o
|
||||
|
||||
ifeq ($(CONFIG_PPC_ISERIES),y)
|
||||
|
@ -111,6 +111,7 @@ int main(void)
|
||||
DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
|
||||
DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
|
||||
DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
|
||||
DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
|
||||
|
||||
/* paca */
|
||||
DEFINE(PACA_SIZE, sizeof(struct paca_struct));
|
||||
|
@ -50,7 +50,7 @@ static unsigned char vga_font[cmapsz];
|
||||
int boot_text_mapped;
|
||||
int force_printk_to_btext = 0;
|
||||
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
/* Calc BAT values for mapping the display and store them
|
||||
* in disp_BAT. Those values are then used from head.S to map
|
||||
* the display during identify_machine() and MMU_Init()
|
||||
@ -93,6 +93,7 @@ btext_prepare_BAT(void)
|
||||
}
|
||||
logicalDisplayBase = (void *) (vaddr + lowbits);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function will enable the early boot text when doing OF booting. This
|
||||
* way, xmon output should work too
|
||||
|
@ -746,6 +746,7 @@ bad_stack:
|
||||
* any task or sent any task a signal, you should use
|
||||
* ret_from_except or ret_from_except_lite instead of this.
|
||||
*/
|
||||
.globl fast_exception_return
|
||||
fast_exception_return:
|
||||
ld r12,_MSR(r1)
|
||||
ld r11,_NIP(r1)
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include <asm/commproc.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
extern void transfer_to_handler(void);
|
||||
extern void do_IRQ(struct pt_regs *regs);
|
||||
extern void machine_check_exception(struct pt_regs *regs);
|
||||
@ -61,14 +62,12 @@ extern int do_signal(sigset_t *, struct pt_regs *);
|
||||
extern int pmac_newworld;
|
||||
extern int sys_sigreturn(struct pt_regs *regs);
|
||||
|
||||
long long __ashrdi3(long long, int);
|
||||
long long __ashldi3(long long, int);
|
||||
long long __lshrdi3(long long, int);
|
||||
|
||||
extern unsigned long mm_ptov (unsigned long paddr);
|
||||
|
||||
EXPORT_SYMBOL(clear_pages);
|
||||
EXPORT_SYMBOL(clear_user_page);
|
||||
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
|
||||
EXPORT_SYMBOL(DMA_MODE_READ);
|
||||
EXPORT_SYMBOL(DMA_MODE_WRITE);
|
||||
EXPORT_SYMBOL(__div64_32);
|
||||
|
||||
EXPORT_SYMBOL(do_signal);
|
||||
EXPORT_SYMBOL(transfer_to_handler);
|
||||
EXPORT_SYMBOL(do_IRQ);
|
||||
@ -77,12 +76,8 @@ EXPORT_SYMBOL(alignment_exception);
|
||||
EXPORT_SYMBOL(program_check_exception);
|
||||
EXPORT_SYMBOL(single_step_exception);
|
||||
EXPORT_SYMBOL(sys_sigreturn);
|
||||
EXPORT_SYMBOL(ppc_n_lost_interrupts);
|
||||
EXPORT_SYMBOL(ppc_lost_interrupts);
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
|
||||
EXPORT_SYMBOL(DMA_MODE_READ);
|
||||
EXPORT_SYMBOL(DMA_MODE_WRITE);
|
||||
#if defined(CONFIG_PPC_PREP)
|
||||
EXPORT_SYMBOL(_prep_type);
|
||||
EXPORT_SYMBOL(ucSystemType);
|
||||
@ -110,7 +105,6 @@ EXPORT_SYMBOL(strnlen);
|
||||
EXPORT_SYMBOL(strcmp);
|
||||
EXPORT_SYMBOL(strncmp);
|
||||
EXPORT_SYMBOL(strcasecmp);
|
||||
EXPORT_SYMBOL(__div64_32);
|
||||
|
||||
EXPORT_SYMBOL(csum_partial);
|
||||
EXPORT_SYMBOL(csum_partial_copy_generic);
|
||||
@ -132,21 +126,21 @@ EXPORT_SYMBOL(_insw_ns);
|
||||
EXPORT_SYMBOL(_outsw_ns);
|
||||
EXPORT_SYMBOL(_insl_ns);
|
||||
EXPORT_SYMBOL(_outsl_ns);
|
||||
EXPORT_SYMBOL(iopa);
|
||||
EXPORT_SYMBOL(mm_ptov);
|
||||
EXPORT_SYMBOL(ioremap);
|
||||
#ifdef CONFIG_44x
|
||||
EXPORT_SYMBOL(ioremap64);
|
||||
#endif
|
||||
EXPORT_SYMBOL(__ioremap);
|
||||
EXPORT_SYMBOL(iounmap);
|
||||
#ifdef CONFIG_PPC32
|
||||
EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
|
||||
#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
|
||||
EXPORT_SYMBOL(ppc_ide_md);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
|
||||
EXPORT_SYMBOL(isa_io_base);
|
||||
EXPORT_SYMBOL(isa_mem_base);
|
||||
EXPORT_SYMBOL(pci_dram_offset);
|
||||
@ -168,31 +162,31 @@ EXPORT_SYMBOL(flush_dcache_all);
|
||||
EXPORT_SYMBOL(start_thread);
|
||||
EXPORT_SYMBOL(kernel_thread);
|
||||
|
||||
EXPORT_SYMBOL(flush_instruction_cache);
|
||||
EXPORT_SYMBOL(giveup_fpu);
|
||||
#ifdef CONFIG_PPC64
|
||||
EXPORT_SYMBOL(__flush_icache_range);
|
||||
#else
|
||||
EXPORT_SYMBOL(flush_icache_range);
|
||||
#endif
|
||||
EXPORT_SYMBOL(flush_dcache_range);
|
||||
EXPORT_SYMBOL(flush_icache_user_range);
|
||||
EXPORT_SYMBOL(flush_dcache_page);
|
||||
EXPORT_SYMBOL(flush_tlb_kernel_range);
|
||||
EXPORT_SYMBOL(flush_tlb_page);
|
||||
EXPORT_SYMBOL(_tlbie);
|
||||
#ifdef CONFIG_ALTIVEC
|
||||
EXPORT_SYMBOL(giveup_altivec);
|
||||
#endif /* CONFIG_ALTIVEC */
|
||||
#ifdef CONFIG_SPE
|
||||
EXPORT_SYMBOL(giveup_spe);
|
||||
#endif /* CONFIG_SPE */
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
EXPORT_SYMBOL(__flush_icache_range);
|
||||
#else
|
||||
EXPORT_SYMBOL(flush_instruction_cache);
|
||||
EXPORT_SYMBOL(flush_icache_range);
|
||||
EXPORT_SYMBOL(flush_tlb_kernel_range);
|
||||
EXPORT_SYMBOL(flush_tlb_page);
|
||||
EXPORT_SYMBOL(_tlbie);
|
||||
#endif
|
||||
EXPORT_SYMBOL(flush_dcache_range);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
EXPORT_SYMBOL(smp_call_function);
|
||||
#ifdef CONFIG_PPC32
|
||||
EXPORT_SYMBOL(smp_hw_index);
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(ppc_md);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ADB
|
||||
EXPORT_SYMBOL(adb_request);
|
||||
@ -205,25 +199,27 @@ EXPORT_SYMBOL(adb_try_handler_change);
|
||||
EXPORT_SYMBOL(cuda_request);
|
||||
EXPORT_SYMBOL(cuda_poll);
|
||||
#endif /* CONFIG_ADB_CUDA */
|
||||
#ifdef CONFIG_PPC_MULTIPLATFORM
|
||||
#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_PPC32)
|
||||
EXPORT_SYMBOL(_machine);
|
||||
#endif
|
||||
#ifdef CONFIG_PPC_PMAC
|
||||
EXPORT_SYMBOL(sys_ctrler);
|
||||
EXPORT_SYMBOL(pmac_newworld);
|
||||
#endif
|
||||
#ifdef CONFIG_VT
|
||||
EXPORT_SYMBOL(kd_mksound);
|
||||
#endif
|
||||
EXPORT_SYMBOL(to_tm);
|
||||
|
||||
EXPORT_SYMBOL(pm_power_off);
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
long long __ashrdi3(long long, int);
|
||||
long long __ashldi3(long long, int);
|
||||
long long __lshrdi3(long long, int);
|
||||
EXPORT_SYMBOL(__ashrdi3);
|
||||
EXPORT_SYMBOL(__ashldi3);
|
||||
EXPORT_SYMBOL(__lshrdi3);
|
||||
#endif
|
||||
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
EXPORT_SYMBOL(cacheable_memcpy);
|
||||
EXPORT_SYMBOL(memset);
|
||||
EXPORT_SYMBOL(memmove);
|
||||
EXPORT_SYMBOL(memscan);
|
||||
@ -234,17 +230,14 @@ EXPORT_SYMBOL(memchr);
|
||||
EXPORT_SYMBOL(screen_info);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
EXPORT_SYMBOL(pm_power_off);
|
||||
EXPORT_SYMBOL(__delay);
|
||||
EXPORT_SYMBOL(timer_interrupt);
|
||||
EXPORT_SYMBOL(irq_desc);
|
||||
EXPORT_SYMBOL(tb_ticks_per_jiffy);
|
||||
EXPORT_SYMBOL(get_wchan);
|
||||
EXPORT_SYMBOL(console_drivers);
|
||||
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
EXPORT_SYMBOL(local_irq_disable);
|
||||
EXPORT_SYMBOL(local_irq_enable);
|
||||
EXPORT_SYMBOL(local_get_flags);
|
||||
EXPORT_SYMBOL(cacheable_memcpy);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_XMON
|
||||
@ -255,22 +248,6 @@ EXPORT_SYMBOL(__up);
|
||||
EXPORT_SYMBOL(__down);
|
||||
EXPORT_SYMBOL(__down_interruptible);
|
||||
|
||||
#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
|
||||
extern void (*debugger)(struct pt_regs *regs);
|
||||
extern int (*debugger_bpt)(struct pt_regs *regs);
|
||||
extern int (*debugger_sstep)(struct pt_regs *regs);
|
||||
extern int (*debugger_iabr_match)(struct pt_regs *regs);
|
||||
extern int (*debugger_dabr_match)(struct pt_regs *regs);
|
||||
extern void (*debugger_fault_handler)(struct pt_regs *regs);
|
||||
|
||||
EXPORT_SYMBOL(debugger);
|
||||
EXPORT_SYMBOL(debugger_bpt);
|
||||
EXPORT_SYMBOL(debugger_sstep);
|
||||
EXPORT_SYMBOL(debugger_iabr_match);
|
||||
EXPORT_SYMBOL(debugger_dabr_match);
|
||||
EXPORT_SYMBOL(debugger_fault_handler);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_8xx
|
||||
EXPORT_SYMBOL(cpm_install_handler);
|
||||
EXPORT_SYMBOL(cpm_free_handler);
|
||||
@ -280,22 +257,24 @@ EXPORT_SYMBOL(cpm_free_handler);
|
||||
EXPORT_SYMBOL(__res);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
EXPORT_SYMBOL(next_mmu_context);
|
||||
EXPORT_SYMBOL(set_context);
|
||||
EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
|
||||
EXPORT_SYMBOL(disarm_decr);
|
||||
#ifdef CONFIG_PPC_STD_MMU
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC_STD_MMU_32
|
||||
extern long mol_trampoline;
|
||||
EXPORT_SYMBOL(mol_trampoline); /* For MOL */
|
||||
EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
|
||||
EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
|
||||
#ifdef CONFIG_SMP
|
||||
extern int mmu_hash_lock;
|
||||
EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
|
||||
#endif /* CONFIG_SMP */
|
||||
extern long *intercept_table;
|
||||
EXPORT_SYMBOL(intercept_table);
|
||||
#endif /* CONFIG_PPC_STD_MMU */
|
||||
EXPORT_SYMBOL(cur_cpu_spec);
|
||||
#endif /* CONFIG_PPC_STD_MMU_32 */
|
||||
#ifdef CONFIG_PPC_PMAC
|
||||
extern unsigned long agp_special_page;
|
||||
EXPORT_SYMBOL(agp_special_page);
|
||||
|
@ -47,6 +47,10 @@
|
||||
#include <asm/sections.h>
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/pSeries_reconfig.h>
|
||||
#include <asm/pci-bridge.h>
|
||||
#ifdef CONFIG_PPC64
|
||||
#include <asm/systemcfg.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBG(fmt...) printk(KERN_ERR fmt)
|
||||
@ -1072,7 +1076,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
||||
} else {
|
||||
/* Check if it's the boot-cpu, set it's hw index in paca now */
|
||||
if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) {
|
||||
u32 *prop = get_flat_dt_prop(node, "reg", NULL);
|
||||
prop = get_flat_dt_prop(node, "reg", NULL);
|
||||
set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop);
|
||||
boot_cpuid_phys = get_hard_smp_processor_id(0);
|
||||
}
|
||||
|
1324
arch/powerpc/kernel/setup_64.c
Normal file
1324
arch/powerpc/kernel/setup_64.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,3 +7,7 @@ obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o
|
||||
obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o memcpy_64.o \
|
||||
usercopy_64.o sstep.o checksum_64.o mem_64.o
|
||||
obj-$(CONFIG_PPC_ISERIES) += e2a.o
|
||||
ifeq ($(CONFIG_PPC64),y)
|
||||
obj-$(CONFIG_SMP) += locks.o
|
||||
endif
|
||||
|
||||
|
95
arch/powerpc/lib/locks.c
Normal file
95
arch/powerpc/lib/locks.c
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Spin and read/write lock operations.
|
||||
*
|
||||
* Copyright (C) 2001-2004 Paul Mackerras <paulus@au.ibm.com>, IBM
|
||||
* Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
|
||||
* Copyright (C) 2002 Dave Engebretsen <engebret@us.ibm.com>, IBM
|
||||
* Rework to support virtual processors
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <linux/config.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
/* waiting for a spinlock... */
|
||||
#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
|
||||
#include <asm/hvcall.h>
|
||||
#include <asm/iSeries/HvCall.h>
|
||||
|
||||
void __spin_yield(raw_spinlock_t *lock)
|
||||
{
|
||||
unsigned int lock_value, holder_cpu, yield_count;
|
||||
struct paca_struct *holder_paca;
|
||||
|
||||
lock_value = lock->slock;
|
||||
if (lock_value == 0)
|
||||
return;
|
||||
holder_cpu = lock_value & 0xffff;
|
||||
BUG_ON(holder_cpu >= NR_CPUS);
|
||||
holder_paca = &paca[holder_cpu];
|
||||
yield_count = holder_paca->lppaca.yield_count;
|
||||
if ((yield_count & 1) == 0)
|
||||
return; /* virtual cpu is currently running */
|
||||
rmb();
|
||||
if (lock->slock != lock_value)
|
||||
return; /* something has changed */
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
|
||||
((u64)holder_cpu << 32) | yield_count);
|
||||
#else
|
||||
plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu),
|
||||
yield_count);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Waiting for a read lock or a write lock on a rwlock...
|
||||
* This turns out to be the same for read and write locks, since
|
||||
* we only know the holder if it is write-locked.
|
||||
*/
|
||||
void __rw_yield(raw_rwlock_t *rw)
|
||||
{
|
||||
int lock_value;
|
||||
unsigned int holder_cpu, yield_count;
|
||||
struct paca_struct *holder_paca;
|
||||
|
||||
lock_value = rw->lock;
|
||||
if (lock_value >= 0)
|
||||
return; /* no write lock at present */
|
||||
holder_cpu = lock_value & 0xffff;
|
||||
BUG_ON(holder_cpu >= NR_CPUS);
|
||||
holder_paca = &paca[holder_cpu];
|
||||
yield_count = holder_paca->lppaca.yield_count;
|
||||
if ((yield_count & 1) == 0)
|
||||
return; /* virtual cpu is currently running */
|
||||
rmb();
|
||||
if (rw->lock != lock_value)
|
||||
return; /* something has changed */
|
||||
#ifdef CONFIG_PPC_ISERIES
|
||||
HvCall2(HvCallBaseYieldProcessor, HvCall_YieldToProc,
|
||||
((u64)holder_cpu << 32) | yield_count);
|
||||
#else
|
||||
plpar_hcall_norets(H_CONFER, get_hard_smp_processor_id(holder_cpu),
|
||||
yield_count);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void __raw_spin_unlock_wait(raw_spinlock_t *lock)
|
||||
{
|
||||
while (lock->slock) {
|
||||
HMT_low();
|
||||
if (SHARED_PROCESSOR)
|
||||
__spin_yield(lock);
|
||||
}
|
||||
HMT_medium();
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(__raw_spin_unlock_wait);
|
@ -186,6 +186,9 @@ config BOOTX_TEXT
|
||||
Say Y here to see progress messages from the boot firmware in text
|
||||
mode. Requires an Open Firmware compatible video card.
|
||||
|
||||
config POWER4
|
||||
def_bool y
|
||||
|
||||
config POWER4_ONLY
|
||||
bool "Optimize for POWER4"
|
||||
default n
|
||||
|
@ -2,14 +2,14 @@
|
||||
# Makefile for the linux ppc64 kernel.
|
||||
#
|
||||
|
||||
EXTRA_CFLAGS += -mno-minimal-toc
|
||||
ifneq ($(CONFIG_PPC_MERGE),y)
|
||||
|
||||
EXTRA_CFLAGS += -mno-minimal-toc
|
||||
extra-y := head.o vmlinux.lds
|
||||
endif
|
||||
|
||||
obj-y := setup.o entry.o irq.o idle.o dma.o \
|
||||
time.o process.o signal.o syscalls.o misc.o ptrace.o \
|
||||
align.o semaphore.o bitops.o pacaData.o \
|
||||
align.o bitops.o pacaData.o \
|
||||
udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
|
||||
ptrace32.o signal32.o rtc.o init_task.o \
|
||||
cputable.o cpu_setup_power4.o \
|
||||
@ -43,7 +43,6 @@ obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
|
||||
obj-$(CONFIG_BOOTX_TEXT) += btext.o
|
||||
obj-$(CONFIG_HVCS) += hvcserver.o
|
||||
|
||||
vio-obj-$(CONFIG_PPC_PSERIES) += pSeries_vio.o
|
||||
obj-$(CONFIG_IBMVIO) += vio.o $(vio-obj-y)
|
||||
obj-$(CONFIG_XICS) += xics.o
|
||||
obj-$(CONFIG_MPIC) += mpic.o
|
||||
@ -59,8 +58,6 @@ obj-$(CONFIG_U3_DART) += u3_iommu.o
|
||||
|
||||
ifdef CONFIG_SMP
|
||||
obj-$(CONFIG_PPC_PMAC) += pmac_smp.o smp-tbsync.o
|
||||
obj-$(CONFIG_PPC_PSERIES) += pSeries_smp.o
|
||||
obj-$(CONFIG_PPC_BPA) += pSeries_smp.o
|
||||
obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o
|
||||
endif
|
||||
|
||||
@ -68,9 +65,62 @@ obj-$(CONFIG_KPROBES) += kprobes.o
|
||||
|
||||
CFLAGS_ioctl32.o += -Ifs/
|
||||
|
||||
ifneq ($(CONFIG_PPC_MERGE),y)
|
||||
ifeq ($(CONFIG_PPC_ISERIES),y)
|
||||
arch/ppc64/kernel/head.o: arch/powerpc/kernel/lparmap.s
|
||||
AFLAGS_head.o += -Iarch/powerpc/kernel
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
# Things still needed from here by the merged ppc code
|
||||
|
||||
obj-y := irq.o idle.o dma.o \
|
||||
time.o signal.o syscalls.o ptrace.o \
|
||||
align.o bitops.o pacaData.o \
|
||||
udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
|
||||
ptrace32.o signal32.o rtc.o \
|
||||
cputable.o cpu_setup_power4.o \
|
||||
iommu.o sysfs.o vdso.o pmc.o firmware.o
|
||||
obj-y += vdso32/ vdso64/
|
||||
|
||||
pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o
|
||||
|
||||
obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y)
|
||||
|
||||
obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o
|
||||
|
||||
obj-$(CONFIG_PPC_PSERIES) += rtasd.o ras.o udbg_16550.o
|
||||
|
||||
obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \
|
||||
bpa_iic.o spider-pic.o
|
||||
|
||||
obj-$(CONFIG_KEXEC) += machine_kexec.o
|
||||
obj-$(CONFIG_EEH) += eeh.o
|
||||
obj-$(CONFIG_PROC_FS) += proc_ppc64.o
|
||||
obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
|
||||
obj-$(CONFIG_SMP) += smp.o
|
||||
obj-$(CONFIG_MODULES) += module.o
|
||||
obj-$(CONFIG_PPC_RTAS) += rtas.o rtas_pci.o
|
||||
obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
|
||||
obj-$(CONFIG_SCANLOG) += scanlog.o
|
||||
obj-$(CONFIG_LPARCFG) += lparcfg.o
|
||||
obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
|
||||
obj-$(CONFIG_HVCS) += hvcserver.o
|
||||
|
||||
obj-$(CONFIG_IBMVIO) += vio.o
|
||||
obj-$(CONFIG_XICS) += xics.o
|
||||
|
||||
obj-$(CONFIG_PPC_MAPLE) += maple_setup.o maple_pci.o maple_time.o \
|
||||
udbg_16550.o
|
||||
|
||||
obj-$(CONFIG_U3_DART) += u3_iommu.o
|
||||
|
||||
ifdef CONFIG_SMP
|
||||
obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_KPROBES) += kprobes.o
|
||||
|
||||
CFLAGS_ioctl32.o += -Ifs/
|
||||
|
||||
endif
|
||||
|
@ -77,6 +77,7 @@ int main(void)
|
||||
DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
|
||||
DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
|
||||
DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
|
||||
DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
|
||||
|
||||
/* paca */
|
||||
DEFINE(PACA_SIZE, sizeof(struct paca_struct));
|
||||
|
@ -99,7 +99,7 @@ get_iost_entry(unsigned long iopt_base, unsigned long io_address, unsigned page_
|
||||
break;
|
||||
|
||||
default: /* not a known compile time constant */
|
||||
BUILD_BUG_ON(1);
|
||||
BUG_ON(1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <asm/nvram.h>
|
||||
#include <asm/cputable.h>
|
||||
#include <asm/ppc-pci.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include "bpa_iic.h"
|
||||
#include "bpa_iommu.h"
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include <asm/of_device.h>
|
||||
#include <asm/lmb.h>
|
||||
#include <asm/mpic.h>
|
||||
#include <asm/udbg.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBG(fmt...) udbg_printf(fmt)
|
||||
|
@ -73,6 +73,7 @@
|
||||
#include <asm/smu.h>
|
||||
#include <asm/pmc.h>
|
||||
#include <asm/mpic.h>
|
||||
#include <asm/udbg.h>
|
||||
|
||||
#include "pmac.h"
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
#ifndef _ASM_POWERPC_HARDIRQ_H
|
||||
#define _ASM_POWERPC_HARDIRQ_H
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/bug.h>
|
||||
|
||||
/* The __last_jiffy_stamp field is needed to ensure that no decrementer
|
||||
* interrupt is lost on SMP machines. Since on most CPUs it is in the same
|
||||
* cache line as local_irq_count, it is cheap to access and is also used on UP
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <linux/errno.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
extern void timer_interrupt(struct pt_regs *);
|
||||
extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
|
||||
|
@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_POWERPC_PPC_ASM_H
|
||||
#define _ASM_POWERPC_PPC_ASM_H
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/config.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
/*
|
||||
@ -87,6 +89,66 @@
|
||||
#define RFDI .long 0x4c00004e /* rfdi instruction */
|
||||
#define RFMCI .long 0x4c00004c /* rfmci instruction */
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
|
||||
#define XGLUE(a,b) a##b
|
||||
#define GLUE(a,b) XGLUE(a,b)
|
||||
|
||||
#define _GLOBAL(name) \
|
||||
.section ".text"; \
|
||||
.align 2 ; \
|
||||
.globl name; \
|
||||
.globl GLUE(.,name); \
|
||||
.section ".opd","aw"; \
|
||||
name: \
|
||||
.quad GLUE(.,name); \
|
||||
.quad .TOC.@tocbase; \
|
||||
.quad 0; \
|
||||
.previous; \
|
||||
.type GLUE(.,name),@function; \
|
||||
GLUE(.,name):
|
||||
|
||||
#define _KPROBE(name) \
|
||||
.section ".kprobes.text","a"; \
|
||||
.align 2 ; \
|
||||
.globl name; \
|
||||
.globl GLUE(.,name); \
|
||||
.section ".opd","aw"; \
|
||||
name: \
|
||||
.quad GLUE(.,name); \
|
||||
.quad .TOC.@tocbase; \
|
||||
.quad 0; \
|
||||
.previous; \
|
||||
.type GLUE(.,name),@function; \
|
||||
GLUE(.,name):
|
||||
|
||||
#define _STATIC(name) \
|
||||
.section ".text"; \
|
||||
.align 2 ; \
|
||||
.section ".opd","aw"; \
|
||||
name: \
|
||||
.quad GLUE(.,name); \
|
||||
.quad .TOC.@tocbase; \
|
||||
.quad 0; \
|
||||
.previous; \
|
||||
.type GLUE(.,name),@function; \
|
||||
GLUE(.,name):
|
||||
|
||||
#else /* 32-bit */
|
||||
|
||||
#define _GLOBAL(n) \
|
||||
.text; \
|
||||
.stabs __stringify(n:F-1),N_FUN,0,0,n;\
|
||||
.globl n; \
|
||||
n:
|
||||
|
||||
#define _KPROBE(n) \
|
||||
.section ".kprobes.text","a"; \
|
||||
.globl n; \
|
||||
n:
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LOADADDR( rn, name )
|
||||
* loads the address of 'name' into 'rn'
|
||||
@ -251,31 +313,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
|
||||
.previous
|
||||
#endif
|
||||
|
||||
/*
|
||||
* On 64-bit cpus, we use the rfid instruction instead of rfi, but
|
||||
* we then have to make sure we preserve the top 32 bits except for
|
||||
* the 64-bit mode bit, which we clear.
|
||||
*/
|
||||
#if defined(CONFIG_PPC64BRIDGE)
|
||||
#define FIX_SRR1(ra, rb) \
|
||||
mr rb,ra; \
|
||||
mfmsr ra; \
|
||||
clrldi ra,ra,1; /* turn off 64-bit mode */ \
|
||||
rldimi ra,rb,0,32
|
||||
#define RFI .long 0x4c000024 /* rfid instruction */
|
||||
#define MTMSRD(r) .long (0x7c000164 + ((r) << 21)) /* mtmsrd */
|
||||
#define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */
|
||||
#elif defined(CONFIG_PPC64)
|
||||
/* Insert the high 32 bits of the MSR into what will be the new
|
||||
MSR (via SRR1 and rfid) This preserves the MSR.SF and MSR.ISF
|
||||
bits. */
|
||||
|
||||
#define FIX_SRR1(ra, rb) \
|
||||
mr rb,ra; \
|
||||
mfmsr ra; \
|
||||
rldimi ra,rb,0,32
|
||||
|
||||
#define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */
|
||||
#ifdef CONFIG_PPC64
|
||||
#define RFI rfid
|
||||
#define MTMSRD(r) mtmsrd r
|
||||
|
||||
#else
|
||||
#define FIX_SRR1(ra, rb)
|
||||
|
@ -196,6 +196,7 @@ extern int prom_n_intr_cells(struct device_node* np);
|
||||
extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
|
||||
extern void prom_add_property(struct device_node* np, struct property* prop);
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
/*
|
||||
* PCI <-> OF matching functions
|
||||
* (XXX should these be here?)
|
||||
@ -207,6 +208,8 @@ extern int pci_device_from_OF_node(struct device_node *node,
|
||||
extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int);
|
||||
extern struct device_node* pci_device_to_OF_node(struct pci_dev *);
|
||||
extern void pci_create_OF_bus_map(void);
|
||||
#endif
|
||||
|
||||
extern struct resource *request_OF_resource(struct device_node* node,
|
||||
int index, const char* name_postfix);
|
||||
extern int release_OF_resource(struct device_node* node, int index);
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <asm/hw_irq.h>
|
||||
#include <asm/ppc_asm.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
/*
|
||||
* Memory barrier.
|
||||
@ -127,6 +128,7 @@ extern void flush_fp_to_thread(struct task_struct *);
|
||||
extern void enable_kernel_altivec(void);
|
||||
extern void giveup_altivec(struct task_struct *);
|
||||
extern void load_up_altivec(struct task_struct *);
|
||||
extern int emulate_altivec(struct pt_regs *);
|
||||
extern void giveup_spe(struct task_struct *);
|
||||
extern void load_up_spe(struct task_struct *);
|
||||
extern int fix_alignment(struct pt_regs *);
|
||||
@ -176,6 +178,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
|
||||
struct thread_struct *next);
|
||||
|
||||
extern unsigned int rtas_data;
|
||||
extern int mem_init_done; /* set on boot once kmalloc can be called */
|
||||
|
||||
/*
|
||||
* Atomic exchange
|
||||
|
@ -106,6 +106,16 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
|
||||
return fetch_dev_dn(dev);
|
||||
}
|
||||
|
||||
static inline int pci_device_from_OF_node(struct device_node *np,
|
||||
u8 *bus, u8 *devfn)
|
||||
{
|
||||
if (!PCI_DN(np))
|
||||
return -ENODEV;
|
||||
*bus = PCI_DN(np)->busno;
|
||||
*devfn = PCI_DN(np)->devfn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
|
||||
{
|
||||
if (bus->self)
|
||||
|
Loading…
Reference in New Issue
Block a user