9792283735
figuring out all the crazy nuances of getting this working, and to Michael Lorenz for testing/fixing my changes on macppc. Tested with a quad-proc 7044-270. Summary of changes: Bumped CPU_MAXNUM to 16 on ofppc. Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs. Fixed a bug in the test for a 64bit bridge cpu early in locore.S Added code to set the interrupt priority for all CPUs with an openpic. Change rtas to probe before cpus, to allow use of the rtas freeze/thaw timebase code routines. Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM. Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow writing to SPR_PIR. Don't write SPR_PIR unless the secondary cpu identifies itself as 0. Change the hatchstack/interrupt stack allocations to allocate a 8192byte interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and allocate them no lower than 0x10000. Allocate them separately to prevent the hatch stack corrupting the interrupt stack later on. If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch() Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp. Add OF_start_cpu(). Add a routine to ofwoea_initppc to spin up secondary procs early, and place them into a spinloop waiting for the hatch routines to be ready. Modify the ipi routines to deal with openpics that reverse byte order on read from an ipi register. (such as on the 7044) Change the rtas setup to allocate the rtas physical base address above the kernel, to avoid mucking up the hatch/interrupt stacks.
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/* $NetBSD: autoconf.h,v 1.13 2008/04/08 02:33:03 garbled Exp $ */
|
|
|
|
#ifndef _OFPPC_AUTOCONF_H_
|
|
#define _OFPPC_AUTOCONF_H_
|
|
|
|
#include <machine/bus.h>
|
|
|
|
struct confargs {
|
|
const char *ca_name;
|
|
u_int ca_node;
|
|
int ca_nreg;
|
|
u_int *ca_reg;
|
|
int ca_nintr;
|
|
int *ca_intr;
|
|
|
|
bus_addr_t ca_baseaddr;
|
|
bus_space_tag_t ca_tag;
|
|
};
|
|
|
|
struct pciio_info {
|
|
uint32_t start;
|
|
uint32_t limit;
|
|
};
|
|
|
|
/* to support machines with more than 4 busses, change the below */
|
|
#define MAX_PCI_BUSSES 4
|
|
struct model_data {
|
|
int ranges_offset;
|
|
struct pciio_info pciiodata[MAX_PCI_BUSSES];
|
|
};
|
|
|
|
extern int console_node;
|
|
extern char model_name[64];
|
|
|
|
#ifdef _KERNEL
|
|
void initppc(u_int, u_int, char *);
|
|
void model_init(void);
|
|
void strayintr(int);
|
|
void dumpsys(void);
|
|
|
|
void inittodr(time_t);
|
|
void resettodr(void);
|
|
void cpu_initclocks(void);
|
|
void decr_intr(struct clockframe *);
|
|
void setstatclockrate(int);
|
|
void init_interrupt(void);
|
|
void init_ofppc_interrupt(void);
|
|
void ofppc_init_comcons(int);
|
|
void copy_disp_props(struct device *, int, prop_dictionary_t);
|
|
|
|
void OF_start_cpu(int, u_int, int);
|
|
|
|
int rascons_cnattach(void);
|
|
#endif /* _KERNEL */
|
|
|
|
#endif /* _OFPPC_AUTOCONF_H_ */
|