PrPMC800 NON-Monarch patch
To whom do I send pathes to the linuxppc_2_4_devel tree?
Enclosed in this mail is a small patch that [partly] enables the PrPMC800 to run in NON-MONARCH mode on a PCI system. The following has been done:
1. arch/ppc/kernel/harrier.c:
consider PCI/PPC memory/IO size mismatches non-fatal, this will probably be changed back when all the memory handling is in place.
2. arch/ppc/platforms/prpmc800.h:
added some comments and a utility macro for harrier register access.
3. arch/ppc/platforms/prpmc800_pci.c:
added some extra interrupt mappings to 'prpmc_map_irq(...)', this routine needs major overhaul though...
added a 'prpmc800_find_hostbridge()' function to find a local harrier chip, this was previously done by reading from PCI_DEVFN(0,0), which does not work in the NON-MONARCH case.
added a NON-MONARCH branch to the 'prpmc800_find_hostbridge(...)' that takes care of (some) of the issues related to not being in control of the PCI bus.
4. include/asm-ppc/harrier.h:
added some new defines
Regards
Anders Blomdell
arch/ppc/kernel/harrier.c +1 -1
@@ -70,7 +70,7 @@ (hose->io_space.end - hose->io_space.start))) {printk ("harrier_init: %s\n" ,"PPC and PCI memory or I/O space sizes don't match" ); -return -1 ; +/* return -1; */ }if ((processor_mpic_base &0xfffc0000 ) != processor_mpic_base) {
arch/ppc/platforms/prpmc800.h +5 -0
@@ -26,9 +26,12 @@#ifndef __ASMPPC_PRPMC800_H#define __ASMPPC_PRPMC800_H +/* These two addresses depend on OTAD3/OTOF3/OTAT3 being correct */ #define PRPMC800_PCI_CONFIG_ADDR 0xfe000cf8#define PRPMC800_PCI_CONFIG_DATA 0xfe000cfc +/* The following addresses may be used for MONARCHS, otherwise +* we have better use what is given to us. */ #define PRPMC800_PROC_PCI_IO_START 0xfe400000U#define PRPMC800_PROC_PCI_IO_END 0xfeefffffU#define PRPMC800_PCI_IO_START 0x00000000U
@@ -52,5 +55,7 @@#define PRPMC800_BASE_BAUD 1843200 +/* Utility macro to access harrier registers from XCSR base */ +#define HARRIER_REG (name) (PRPMC800_HARRIER_XCSR_BASE+HARRIER_##name##_OFF)#endif /* __ASMPPC_PRPMC800_H */
arch/ppc/platforms/prpmc800_pci.c +136 -6
172 lines not on this page · raw message
include/asm-ppc/harrier.h +22 -0
@@ -21,6 +21,10 @@#define HARRIER_VEND_DEV_ID 0x480b1057 +/* Harrier PCI status register */ +#define HARRIER_PSTA_PCI_OFF 0x83 +#define HARRIER_PSTA_LBA_MASK 0x80 +/* * Define outbound register offsets. */
@@ -33,13 +37,29 @@#define HARRIER_OTAD3_OFF 0x238#define HARRIER_OTOF3_OFF 0x23c +#define HARRIER_OTOF_ENABLE 0x80 +/* * Define inbound register offsets. */ +#define HARRIER_ITBAR0_OFF 0x314 +#define HARRIER_ITBAR1_OFF 0x318 +#define HARRIER_ITBAR2_OFF 0x31c +#define HARRIER_ITBAR3_OFF 0x320#define HARRIER_ITSZ0_OFF 0x348 +#define HARRIER_ITAT0_OFF 0x34c#define HARRIER_ITSZ1_OFF 0x350 +#define HARRIER_ITAT1_OFF 0x354#define HARRIER_ITSZ2_OFF 0x358 +#define HARRIER_ITAT2_OFF 0x35c#define HARRIER_ITSZ3_OFF 0x360 +#define HARRIER_ITAT3_OFF 0x364 + +#define HARRIER_ITBAR_BASE_MASK 0xffff0000 +#define HARRIER_ITAT_ENABLE 0x80 +#define HARRIER_ITAT_MEMORY 0x40 +#define HARRIER_ITSZ_SIZE_MASK 0x0f +#define HARRIER_ITSZ_OFFSET_MASK 0xffff0000/* * Define the Memory Controller register offsets.
@@ -65,8 +85,10 @@#define HARRIER_UCTL_OFF 0xd0#define HARRIER_XTAL64_MASK 0x02 +/* Should accesses (and masks) to the MCSR really be 8 bit? */ #define HARRIER_MISC_CSR_OFF 0x1c#define HARRIER_RSTOUT_MASK 0x01 +#define HARRIER_SCON_MASK 0x08#define HARRIER_MBAR_OFF 0xe0#define HARRIER_MPIC_CSR_OFF 0xe4