Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Feb 8, 2006
2 parents f30ac31 + 7d4d615 commit fe69102
Show file tree
Hide file tree
Showing 24 changed files with 123 additions and 88 deletions.
8 changes: 8 additions & 0 deletions Documentation/powerpc/booting-without-of.txt
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,10 @@ address which can extend beyond that limit.
- device_type : Should be "soc"
- ranges : Should be defined as specified in 1) to describe the
translation of SOC addresses for memory mapped SOC registers.
- bus-frequency: Contains the bus frequency for the SOC node.
Typically, the value of this field is filled in by the boot
loader.


Recommended properties:

Expand Down Expand Up @@ -919,6 +923,7 @@ SOC.
device_type = "soc";
ranges = <00000000 e0000000 00100000>
reg = <e0000000 00003000>;
bus-frequency = <0>;
}


Expand Down Expand Up @@ -1170,6 +1175,8 @@ platforms are moved over to use the flattened-device-tree model.

mdio@24520 {
reg = <24520 20>;
device_type = "mdio";
compatible = "gianfar";

ethernet-phy@0 {
......
Expand Down Expand Up @@ -1317,6 +1324,7 @@ not necessary as they are usually the same as the root node.
device_type = "soc";
ranges = <00000000 e0000000 00100000>
reg = <e0000000 00003000>;
bus-frequency = <0>;

mdio@24520 {
reg = <24520 20>;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/fpu.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _GLOBAL(load_up_fpu)
#else
ld r4,PACACURRENT(r13)
addi r5,r4,THREAD /* Get THREAD */
ld r4,THREAD_FPEXC_MODE(r5)
lwz r4,THREAD_FPEXC_MODE(r5)
ori r12,r12,MSR_FP
or r12,r12,r4
std r12,_MSR(r1)
Expand Down
5 changes: 3 additions & 2 deletions arch/powerpc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,12 @@ iSeries_secondary_smp_loop:

.globl decrementer_iSeries_masked
decrementer_iSeries_masked:
/* We may not have a valid TOC pointer in here. */
li r11,1
ld r12,PACALPPACAPTR(r13)
stb r11,LPPACADECRINT(r12)
LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy)
lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12)
LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
lwz r12,0(r12)
mtspr SPRN_DEC,r12
/* fall through */

Expand Down
9 changes: 6 additions & 3 deletions arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,

spin_unlock_irqrestore(&(tbl->it_lock), flags);

/* Make sure updates are seen by hardware */
mb();

DBG("mapped %d elements:\n", outcount);

/* For the sake of iommu_unmap_sg, we clear out the length in the
Expand All @@ -347,6 +344,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
outs->dma_address = DMA_ERROR_CODE;
outs->dma_length = 0;
}

/* Make sure updates are seen by hardware */
mb();

return outcount;

failure:
Expand All @@ -358,6 +359,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr)
>> PAGE_SHIFT;
__iommu_free(tbl, vaddr, npages);
s->dma_address = DMA_ERROR_CODE;
s->dma_length = 0;
}
}
spin_unlock_irqrestore(&(tbl->it_lock), flags);
Expand Down
38 changes: 35 additions & 3 deletions arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,12 @@ void __init finish_device_tree(void)
size = 16;
finish_node(allnodes, &size, 1);
size -= 16;
end = start = (unsigned long) __va(lmb_alloc(size, 128));

if (0 == size)
end = start = 0;
else
end = start = (unsigned long)__va(lmb_alloc(size, 128));

finish_node(allnodes, &end, 0);
BUG_ON(end != start + size);

Expand Down Expand Up @@ -1398,8 +1403,8 @@ struct device_node *of_find_node_by_name(struct device_node *from,

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
for (; np != 0; np = np->allnext)
if (np->name != 0 && strcasecmp(np->name, name) == 0
for (; np != NULL; np = np->allnext)
if (np->name != NULL && strcasecmp(np->name, name) == 0
&& of_node_get(np))
break;
if (from)
Expand Down Expand Up @@ -1917,3 +1922,30 @@ int prom_update_property(struct device_node *np,

return 0;
}

#ifdef CONFIG_KEXEC
/* We may have allocated the flat device tree inside the crash kernel region
* in prom_init. If so we need to move it out into regular memory. */
void kdump_move_device_tree(void)
{
unsigned long start, end;
struct boot_param_header *new;

start = __pa((unsigned long)initial_boot_params);
end = start + initial_boot_params->totalsize;

if (end < crashk_res.start || start > crashk_res.end)
return;

new = (struct boot_param_header*)
__va(lmb_alloc(initial_boot_params->totalsize, PAGE_SIZE));

memcpy(new, initial_boot_params, initial_boot_params->totalsize);

initial_boot_params = new;

DBG("Flat device tree blob moved to %p\n", initial_boot_params);

/* XXX should we unreserve the old DT? */
}
#endif /* CONFIG_KEXEC */
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,10 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
*/
prom_init_stdout();

/* Bail if this is a kdump kernel. */
if (PHYSICAL_START > 0)
prom_panic("Error: You can't boot a kdump kernel from OF!\n");

/*
* Check for an initrd
*/
Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/kernel/prom_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,10 @@ u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
if (parent == NULL)
return NULL;
bus = of_match_bus(parent);
if (strcmp(bus->name, "pci"))
if (strcmp(bus->name, "pci")) {
of_node_put(parent);
return NULL;
}
bus->count_cells(dev, &na, &ns);
of_node_put(parent);
if (!OF_CHECK_COUNTS(na, ns))
Expand Down
12 changes: 6 additions & 6 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <asm/prom.h>
#include <asm/rtas.h>
#include <asm/hvcall.h>
#include <asm/semaphore.h>
#include <asm/machdep.h>
#include <asm/page.h>
Expand Down Expand Up @@ -565,6 +566,7 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
#ifdef CONFIG_PPC_PSERIES
static void rtas_percpu_suspend_me(void *info)
{
int i;
long rc;
long flags;
struct rtas_suspend_me_data *data =
Expand All @@ -587,18 +589,16 @@ static void rtas_percpu_suspend_me(void *info)

if (rc == H_Continue) {
data->waiting = 0;
rtas_call(ibm_suspend_me_token, 0, 1,
data->args->args);
data->args->args[data->args->nargs] =
rtas_call(ibm_suspend_me_token, 0, 1, NULL);
for_each_cpu(i)
plpar_hcall_norets(H_PROD,i);
} else {
data->waiting = -EBUSY;
printk(KERN_ERR "Error on H_Join hypervisor call\n");
}

out:
/* before we restore interrupts, make sure we don't
* generate a spurious soft lockup errors
*/
touch_softlockup_watchdog();
local_irq_restore(flags);
return;
}
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/kernel/rtas_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,7 @@ static void rtas_flash_firmware(int reboot_type)
static void remove_flash_pde(struct proc_dir_entry *dp)
{
if (dp) {
if (dp->data != NULL)
kfree(dp->data);
kfree(dp->data);
dp->owner = NULL;
remove_proc_entry(dp->name, dp->parent);
}
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ void __init setup_system(void)
{
DBG(" -> setup_system()\n");

#ifdef CONFIG_KEXEC
kdump_move_device_tree();
#endif
/*
* Unflatten the device-tree passed by prom_init or kexec
*/
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@ int __devinit start_secondary(void *unused)
if (smp_ops->take_timebase)
smp_ops->take_timebase();

if (system_state > SYSTEM_BOOTING)
per_cpu(last_jiffy, cpu) = get_tb();

spin_lock(&call_lock);
cpu_set(cpu, cpu_online_map);
spin_unlock(&call_lock);
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@ void __init generic_calibrate_decr(void)

ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */
node_found = 0;
if (cpu != 0) {
if (cpu) {
fp = (unsigned int *)get_property(cpu, "timebase-frequency",
NULL);
if (fp != 0) {
if (fp) {
node_found = 1;
ppc_tb_freq = *fp;
}
Expand All @@ -626,10 +626,10 @@ void __init generic_calibrate_decr(void)

ppc_proc_freq = DEFAULT_PROC_FREQ;
node_found = 0;
if (cpu != 0) {
if (cpu) {
fp = (unsigned int *)get_property(cpu, "clock-frequency",
NULL);
if (fp != 0) {
if (fp) {
node_found = 1;
ppc_proc_freq = *fp;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/udbg_16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
}

#ifdef CONFIG_PPC_MAPLE
void udbg_maple_real_putc(unsigned char c)
void udbg_maple_real_putc(char c)
{
if (udbg_comport) {
while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
Expand Down
4 changes: 4 additions & 0 deletions arch/powerpc/mm/lmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ long __init lmb_reserve(unsigned long base, unsigned long size)
{
struct lmb_region *_rgn = &(lmb.reserved);

BUG_ON(0 == size);

return lmb_add_region(_rgn, base, size);
}

Expand Down Expand Up @@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
long i, j;
unsigned long base = 0;

BUG_ON(0 == size);

#ifdef CONFIG_PPC32
/* On 32-bit, make sure we allocate lowmem */
if (max_addr == LMB_ALLOC_ANYWHERE)
Expand Down
14 changes: 2 additions & 12 deletions arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,12 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
{
clear_page(page);

if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
return;
/*
* We shouldnt have to do this, but some versions of glibc
* require it (ld.so assumes zero filled pages are icache clean)
* - Anton
*/

/* avoid an atomic op if possible */
if (test_bit(PG_arch_1, &pg->flags))
clear_bit(PG_arch_1, &pg->flags);
flush_dcache_page(pg);
}
EXPORT_SYMBOL(clear_user_page);

Expand All @@ -469,12 +464,7 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
return;
#endif

if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
return;

/* avoid an atomic op if possible */
if (test_bit(PG_arch_1, &pg->flags))
clear_bit(PG_arch_1, &pg->flags);
flush_dcache_page(pg);
}

void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ obj-y += interrupt.o iommu.o setup.o spider-pic.o
obj-y += pervasive.o

obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SPU_FS) += spufs/ spu-base.o
obj-$(CONFIG_SPU_FS) += spu-base.o spufs/

spu-base-y += spu_base.o spu_priv1.o

Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/chrp/chrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
extern void chrp_nvram_init(void);
extern void chrp_get_rtc_time(struct rtc_time *);
extern int chrp_set_rtc_time(struct rtc_time *);
extern void chrp_calibrate_decr(void);
extern long chrp_time_init(void);

extern void chrp_find_bridges(void);
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/chrp/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ static void __init setup_peg2(struct pci_controller *hose, struct device_node *d
struct device_node *root = find_path_device("/");
struct device_node *rtas;

of_node_get(root);
rtas = of_find_node_by_name (root, "rtas");
if (rtas) {
hose->ops = &rtas_pci_ops;
of_node_put(rtas);
} else {
printk ("RTAS supporting Pegasos OF not found, please upgrade"
" your firmware\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/chrp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ void __init chrp_init(void)
ppc_md.halt = rtas_halt;

ppc_md.time_init = chrp_time_init;
ppc_md.calibrate_decr = chrp_calibrate_decr;
ppc_md.calibrate_decr = generic_calibrate_decr;

/* this may get overridden with rtas routines later... */
ppc_md.set_rtc_time = chrp_set_rtc_time;
Expand Down
21 changes: 0 additions & 21 deletions arch/powerpc/platforms/chrp/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,3 @@ void chrp_get_rtc_time(struct rtc_time *tm)
tm->tm_mon = mon;
tm->tm_year = year;
}


void __init chrp_calibrate_decr(void)
{
struct device_node *cpu;
unsigned int freq, *fp;

/*
* The cpu node should have a timebase-frequency property
* to tell us the rate at which the decrementer counts.
*/
freq = 16666000; /* hardcoded default */
cpu = find_type_devices("cpu");
if (cpu != 0) {
fp = (unsigned int *)
get_property(cpu, "timebase-frequency", NULL);
if (fp != 0)
freq = *fp;
}
ppc_tb_freq = freq;
}
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
{
/* Don't risk a hypervisor call if we're crashing */
if (!crash_shutdown) {
if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
unsigned long vpa = __pa(get_lppaca());

if (unregister_vpa(hard_smp_processor_id(), vpa)) {
Expand Down
Loading

0 comments on commit fe69102

Please sign in to comment.