From 0dabbeeb80995c90b1153b7521898146cfd4f755 Mon Sep 17 00:00:00 2001 From: "crediar@rypp.net" Date: Sat, 30 Jun 2012 04:38:56 +0000 Subject: [PATCH] EHCI: *Changed the ehci_bulk_message buffer address, which fixes the gameid when using WiiRd *Some code clean up git-svn-id: svn://localhost/Users/andi/Downloads/code/trunk@15 be6c1b03-d731-4111-a574-e37d80d43941 --- ehci-mem.c | 35 ++++++++++++++--------------------- ehci.c | 6 +++--- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/ehci-mem.c b/ehci-mem.c index 94ce1fb..c7e4764 100644 --- a/ehci-mem.c +++ b/ehci-mem.c @@ -42,44 +42,37 @@ static inline struct ehci_qtd * ehci_qtd_alloc(void) int ehci_mem_init (void) { int i; - u32 ptr = 0x17FF000; -// ehci->periodic = ehci_maligned(DEFAULT_I_TDPS * sizeof(__le32),32,4096); + u32 ptr = 0x1800000 - DEFAULT_I_TDPS * sizeof(__le32); ehci->periodic = (u32*)ptr; - ehci->periodic_dma = ehci_virt_to_dma(ehci->periodic); for (i = 0; i < DEFAULT_I_TDPS; i++) ehci->periodic[i] = EHCI_LIST_END(); - ehci_writel(ehci->periodic_dma, &ehci->regs->frame_list); + ehci_writel( ehci->periodic_dma, &ehci->regs->frame_list ); for(i=0;iqtds[i] = ehci_maligned(sizeof(struct ehci_qtd),32,4096); - - ptr -= sizeof(struct ehci_qtd); + { + ptr -= sizeof(struct ehci_qtd); ehci->qtds[i] = (struct ehci_qtd*)(ptr); } ehci->qtd_used = 0; -// ehci->asyncqh = ehci_maligned(sizeof(struct ehci_qh),32,4096); - ptr -= sizeof(struct ehci_qh); + ptr -= sizeof(struct ehci_qh); ehci->asyncqh = (struct ehci_qh*)ptr; - ehci->asyncqh->ehci = ehci; - ehci->asyncqh->qh_dma = ehci_virt_to_dma(ehci->asyncqh); - ehci->asyncqh->qtd_head = NULL; - -// ehci->async = ehci_maligned(sizeof(struct ehci_qh),32,4096); - - ptr -= sizeof(struct ehci_qh); + ehci->asyncqh->ehci = ehci; + ehci->asyncqh->qh_dma = ehci_virt_to_dma(ehci->asyncqh); + ehci->asyncqh->qtd_head = NULL; + + ptr -= sizeof(struct ehci_qh); ehci->async = (struct ehci_qh*)ptr; - ehci->async->ehci = ehci; - ehci->async->qh_dma = ehci_virt_to_dma(ehci->async); - ehci->async->qtd_head = NULL; + ehci->async->ehci = ehci; + ehci->async->qh_dma = ehci_virt_to_dma(ehci->async); + ehci->async->qtd_head = NULL; - return 0; + return 0; } diff --git a/ehci.c b/ehci.c index 529a5c0..1bde0a4 100644 --- a/ehci.c +++ b/ehci.c @@ -637,13 +637,13 @@ s32 ehci_bulk_message(struct ehci_device *dev,u8 bEndpoint,u16 wLength,void *rpD // hexdump( urb.transfer_buffer, urb.transfer_buffer_length ); if( ((u32)rpData >> 28) == 0xF ) { - memcpy( (void*)0x1800, rpData, wLength ); + memcpy( (void*)0xFE0, rpData, wLength ); - urb.transfer_buffer = (u8*)0x1800; + urb.transfer_buffer = (u8*)0xFE0; ret = ehci_do_urb( dev, &urb ); - memcpy( rpData, (void*)0x1800, wLength ); + memcpy( rpData, (void*)0xFE0, wLength ); } else { ret = ehci_do_urb( dev, &urb );