From: John David Anglin <dave.anglin@bell.net>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Sven Schnelle <svens@stackframe.org>
Cc: linux-parisc@vger.kernel.org, deller@gmx.de
Subject: Re: some progress with radeon on C8000
Date: Wed, 2 Oct 2019 16:37:41 -0400 [thread overview]
Message-ID: <c9ef7686-96fc-e4ed-33d2-ebee7fb4aeed@bell.net> (raw)
In-Reply-To: <20191002141907.GA8897@alpha.franken.de>
On 2019-10-02 10:19 a.m., Thomas Bogendoerfer wrote:
> On Sat, Sep 28, 2019 at 11:44:36PM +0200, Sven Schnelle wrote:
>> Hi List,
>>
>> i've spent quite some time this evening debugging why the Fire GL
>> doesn't work in my C8000. As reading debug output didn't give me
>> much insights, i decided to throw some Hardware at the Problem and
>> connect a Logic Analyzer to the C8000. For that i switched to an old
>> PCI Radeon 7000 which shows the same ring test failure.
> below patch (with debug print left in) got PCI radeon working for me, when
> I played with it last time. The added fdc is a real fix, while the change
> in parisc_agp_mask_memory is just a hack. The big problem there is to get
> virtual address where the memory is mapped to in user space...
>
> Thomas.
>
>
> diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
> index 15f2e7025b78..756bc4a265d9 100644
> --- a/drivers/char/agp/parisc-agp.c
> +++ b/drivers/char/agp/parisc-agp.c
> @@ -20,6 +20,7 @@
> #include <linux/agp_backend.h>
> #include <linux/log2.h>
> #include <linux/slab.h>
> +#include <linux/pagemap.h>
>
> #include <asm/parisc-device.h>
> #include <asm/ropes.h>
> @@ -162,6 +163,16 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
> info->gatt[j] =
> parisc_agp_mask_memory(agp_bridge,
> paddr, type);
> + asm volatile("fdc %%r0(%0)" : : "r" (&info->gatt[j]));
> +#if 0
> +#if 0
> + printk("i %x j %lx page %p va %lx paddr %lx gatt %lx\n",
> + i, j, mem->pages[i], __va(paddr), paddr, info->gatt[j]);
> +#else
> + printk("i %x j %lx page %p va %lx paddr %lx\n",
> + i, j, mem->pages[i], __va(paddr), paddr);
> +#endif
> +#endif
> }
> }
>
> @@ -184,7 +195,7 @@ parisc_agp_remove_memory(struct agp_memory *mem, off_t pg_start, int type)
> io_pg_start = info->io_pages_per_kpage * pg_start;
> io_pg_count = info->io_pages_per_kpage * mem->page_count;
> for (i = io_pg_start; i < io_pg_count + io_pg_start; i++) {
> - info->gatt[i] = agp_bridge->scratch_page;
> + // info->gatt[i] = agp_bridge->scratch_page;
> }
>
> agp_bridge->driver->tlb_flush(mem);
> @@ -195,7 +206,22 @@ static unsigned long
> parisc_agp_mask_memory(struct agp_bridge_data *bridge, dma_addr_t addr,
> int type)
> {
> - return SBA_PDIR_VALID_BIT | addr;
> +#if 1
> + u64 pa;
> + register unsigned ci; /* coherent index */
> +
> + pa = addr & IOVP_MASK;
> + mtsp(0,1);
> + asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (__va(pa)));
I believe you can remove the mtsp and just use "lci 0(%1), %0" to load the coherence index. The space
registers sr4 to sr7 are always 0 in kernel.
> +
> + pa |= (ci >> PAGE_SHIFT) & 0xff; /* move CI (8 bits) into lowest byte */
> +
> + pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */
> +
> + return cpu_to_le64(pa);
> +#else
> + return cpu_to_le64(SBA_PDIR_VALID_BIT | addr);
> +#endif
> }
>
> static void
>
Dave
--
John David Anglin dave.anglin@bell.net
next prev parent reply other threads:[~2019-10-02 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-28 21:44 some progress with radeon on C8000 Sven Schnelle
2019-10-02 14:19 ` Thomas Bogendoerfer
2019-10-02 20:37 ` John David Anglin [this message]
2019-10-04 12:06 ` Thomas Bogendoerfer
2019-10-04 12:36 ` Helge Deller
2019-10-07 7:33 ` Sven Schnelle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c9ef7686-96fc-e4ed-33d2-ebee7fb4aeed@bell.net \
--to=dave.anglin@bell.net \
--cc=deller@gmx.de \
--cc=linux-parisc@vger.kernel.org \
--cc=svens@stackframe.org \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).