> -----Original Message----- > From: > linuxppc-dev-bounces+tiejun.chen=windriver....@lists.ozlabs.or > g > [mailto:linuxppc-dev-bounces+tiejun.chen=windriver....@lists.o zlabs.org] On Behalf Of david.hag...@gmail.com > Sent: Wednesday, September 22, 2010 11:56 PM > To: linuxppc-...@ozlabs.org > Subject: MPC8641D PEX: programming OWBAR in Endpoint mode? > > I am trying to get the PCIe interfaces of a Freescale > MPC8641D working in endpoint mode (i.e. as a PCI device > rather than a PCI root complex host). >
As far as I recalled on 4xx the u-boot support for dynamic configuration of PCIe ports for the targets equipped with PCIe interfaces. Often this is done via the "pcie_mode" environement variable on the u-boot prompt. On there you can set to "EP" or "RP" for endpoint or rootpoint mode. But for Freescale MPC86xx this should be set accordin to the external configure pin. > I can get the device to show up on the host's PCI bus, I can This only ensure you can access the PCIe configure space. > program the inbound ATMUs such that the BARS are updated when > the host (re-)scans them, but I cannot for the life of me get What value are configured to IntBound REGs? > the PPC's Outbound ATMUS to work. > > When I attempt to program them, I can program ALL the > registers EXCEPT the OWBAR - which steadfastly remains 0 no > matter what I write to it. > How do you configure OWS of PEXOWAR? I means you still access that if OWS is match the whole target memory size even when '0' is as the internal platform address. > As a result, when I attempt to bus master out from the PPC to > the PCIe address spaces via the outbound ATMUs, I get a bus > fault on the PPC as there is no device at the address I am accessing. > > I've double-checked the LAWs to make sure the PEX is mapped > into local space, I've put the OWBAR in that address space, > I've tried different outbound ATMUs, and NOTHING works. Not > ATMU0, not ATMU1, etc. > > I've been trying to work with our Freescale rep, but I am > getting nowhere on that front. > > Does anybody have any suggestions on what I might be doing > wrong? I mean, it looks like it should be a simple > out_be32(addr_of_OWBAR,value), just like all the other > accesses to the ATMU registers that seem to be working (as > in, I read back what I wrote). Out_be32 should be fine for atmu REGs. And also you can refe to the function, setup_pci_atmu & setup_one_atmu, on the file, arch/powerpc/sysdev/fsl_pci.c, to know how to access atmu REGs. Often you should disable them, configure then enable/invoke atmu antry as normal configuring sequent. Additionally I'm a bit afraid your initial phase :) As you know PCIe would be used as RC mode on Freescale PowerPC kernel. So I don't know if you also drop this path on your kernel to conflict each other :) Cheers Tiejun > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev > _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev