diff options
author | Eric Biederman <ebiederm@xmission.com> | 2004-11-18 22:38:08 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2004-11-18 22:38:08 +0000 |
commit | a9e632c2ac29c60872e7e4f9314263b34ce5031d (patch) | |
tree | 2a76647833896d68306553c548a65743c87b417e /src/arch/ppc/include | |
parent | bec8acedf18b4d35f95b4a4c254eb925bd4d53bd (diff) |
- First stab at getting the ppc ports building and working.
- The sandpointx3+altimus has been consolidated into one directory for now.
- Added support for having different versions of the pci access functions
on a per bus basis if needed.
Hopefully I have not broken something inadvertently.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1786 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/ppc/include')
-rw-r--r-- | src/arch/ppc/include/arch/cpu.h | 57 | ||||
-rw-r--r-- | src/arch/ppc/include/arch/pci_ops.h | 8 |
2 files changed, 61 insertions, 4 deletions
diff --git a/src/arch/ppc/include/arch/cpu.h b/src/arch/ppc/include/arch/cpu.h index 48293b2425..e0ed4ff66a 100644 --- a/src/arch/ppc/include/arch/cpu.h +++ b/src/arch/ppc/include/arch/cpu.h @@ -1,3 +1,60 @@ +#ifndef ARCH_CPU_H +#define ARCH_CPU_H /* * this should probably integrate code from src/arch/ppc/lib/cpuid.c */ + +struct cpu_device_id { + unsigned pvr; +}; + +struct cpu_driver { + struct device_operations *ops; + struct cpu_device_id *id_table; +}; + +#ifndef STACK_SIZE +#error STACK_SIZE not defined +#endif + +/* The basic logic comes from the Linux kernel. + * The invariant is that (1 << 31 - STACK_BITS) == STACK_SIZE + * I wish there was simpler way to support multiple stack sizes. + * Oh well. + */ +#if STACK_SIZE == 4096 +#define STACK_BITS "19" +#elif STACK_SIZE == 8192 +#define STACK_BITS "18" +#elif STACK_SIZE == 16384 +#define STACK_BITS "17" +#elif STACK_SIZE == 32768 +#define STACK_BITS "16" +#elif STACK_SIZE == 65536 +#define STACK_BITS "15" +#else +#error Unimplemented stack size +#endif + + +struct cpu_info { + struct device *cpu; + unsigned long index; +}; + + +static inline struct cpu_info *cpu_info(void) +{ + struct cpu_info *ci; + __asm__("rlwinm %0,1,0,0," STACK_BITS : "=r"(ci)); + return ci; +} + +static inline unsigned long cpu_index(void) +{ + struct cpu_info *ci; + ci = cpu_info(); + return ci->index; +} + +#endif /* ARCH_CPU_H */ diff --git a/src/arch/ppc/include/arch/pci_ops.h b/src/arch/ppc/include/arch/pci_ops.h index 6f9c3af3af..95f8941e42 100644 --- a/src/arch/ppc/include/arch/pci_ops.h +++ b/src/arch/ppc/include/arch/pci_ops.h @@ -1,6 +1,6 @@ -#ifndef ARCH_I386_PCI_OPS_H -#define ARCH_I386_PCI_OPS_H +#ifndef ARCH_PPC_PCI_OPS_H +#define ARCH_PPC_PCI_OPS_H -void pci_set_method(void); +const struct pci_bus_operations pci_ppc_conf1; -#endif /* ARCH_I386_PCI_OPS_H */ +#endif /* ARCH_PPC_PCI_OPS_H */ |