Date: Wed, 7 Apr 2010 15:05:30 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 176622 for review Message-ID: <201004071505.o37F5UWM065715@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@176622?ac=10 Change 176622 by raj@raj_fdt on 2010/04/07 15:04:32 Initial support for MPC85XX PCI / PCI-Express nodes. Affected files ... .. //depot/projects/fdt/sys/conf/files.powerpc#21 edit .. //depot/projects/fdt/sys/dev/fdt/fdt_pci.c#2 edit .. //depot/projects/fdt/sys/powerpc/include/ocpbus.h#2 delete .. //depot/projects/fdt/sys/powerpc/mpc85xx/mpc85xx.c#2 edit .. //depot/projects/fdt/sys/powerpc/mpc85xx/mpc85xx.h#4 edit .. //depot/projects/fdt/sys/powerpc/mpc85xx/ocpbus.c#4 delete .. //depot/projects/fdt/sys/powerpc/mpc85xx/ocpbus.h#3 delete .. //depot/projects/fdt/sys/powerpc/mpc85xx/pci_fdt.c#1 add .. //depot/projects/fdt/sys/powerpc/mpc85xx/pci_ocp.c#5 delete Differences ... ==== //depot/projects/fdt/sys/conf/files.powerpc#21 (text+ko) ==== @@ -119,7 +119,7 @@ powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx powerpc/mpc85xx/openpic_fdt.c optional fdt -powerpc/mpc85xx/pci_ocp.c optional pci mpc85xx +powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_real.c optional aim ==== //depot/projects/fdt/sys/dev/fdt/fdt_pci.c#2 (text+ko) ==== @@ -44,8 +44,8 @@ #include "ofw_bus_if.h" +#define DEBUG #undef DEBUG -#define DEBUG #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ ==== //depot/projects/fdt/sys/powerpc/mpc85xx/mpc85xx.c#2 (text+ko) ==== @@ -29,6 +29,9 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/rman.h> #include <vm/vm.h> #include <vm/vm_param.h> @@ -37,7 +40,6 @@ #include <machine/cpufunc.h> #include <machine/spr.h> -#include <powerpc/mpc85xx/ocpbus.h> #include <powerpc/mpc85xx/mpc85xx.h> /* @@ -129,6 +131,39 @@ return (ENOENT); } +int +law_pci_target(struct resource *res, int *trgt_mem, int *trgt_io) +{ + u_long start; + uint32_t ver; + int trgt, rv; + + ver = SVR_VER(mfspr(SPR_SVR)); + + start = rman_get_start(res) & 0xf000; + + rv = 0; + trgt = -1; + switch (start) { + case 0x8000: + trgt = 0; + break; + case 0x9000: + trgt = 1; + break; + case 0xa000: + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + trgt = 2; + else + rv = EINVAL; + break; + default: + rv = ENXIO; + } + *trgt_mem = *trgt_io = trgt; + return (rv); +} + void cpu_reset(void) { ==== //depot/projects/fdt/sys/powerpc/mpc85xx/mpc85xx.h#4 (text+ko) ==== @@ -47,15 +47,6 @@ #define OCP85XX_LAWBAR(n) (CCSRBAR_VA + 0xc08 + 0x20 * (n)) #define OCP85XX_LAWSR(n) (CCSRBAR_VA + 0xc10 + 0x20 * (n)) -#define OCP85XX_TGTIF_PCI0 2 -#define OCP85XX_TGTIF_PCI1 1 -#define OCP85XX_TGTIF_PCI2 0 -#if 0 -#define OCP85XX_TGTIF_PCI0 0 -#define OCP85XX_TGTIF_PCI1 1 -#define OCP85XX_TGTIF_PCI2 2 -#endif - #define OCP85XX_TGTIF_LBC 4 #define OCP85XX_TGTIF_RAM_INTL 11 #define OCP85XX_TGTIF_RIO 12 @@ -104,5 +95,6 @@ int law_enable(int trgt, u_long addr, u_long size); int law_disable(int trgt, u_long addr, u_long size); int law_getmax(void); +int law_pci_target(struct resource *, int *, int *); #endif /* _MPC85XX_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004071505.o37F5UWM065715>