Revert USB-related MIPS changes
This commit is contained in:
parent
537ee0a5f1
commit
0ee6924f69
3 changed files with 12 additions and 46 deletions
|
@ -27,9 +27,6 @@
|
||||||
#include <grub/i386/io.h>
|
#include <grub/i386/io.h>
|
||||||
#include <grub/time.h>
|
#include <grub/time.h>
|
||||||
|
|
||||||
#define vtop(x) ((x) & 0x7fffffff)
|
|
||||||
#define ptov(x) ((x) | 0x80000000)
|
|
||||||
|
|
||||||
struct grub_ohci_hcca
|
struct grub_ohci_hcca
|
||||||
{
|
{
|
||||||
/* Pointers to Interrupt Endpoint Descriptors. Not used by
|
/* Pointers to Interrupt Endpoint Descriptors. Not used by
|
||||||
|
@ -155,7 +152,7 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||||
if (! o)
|
if (! o)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
o->iobase = (grub_uint32_t *) ptov (base);
|
o->iobase = (grub_uint32_t *) base;
|
||||||
|
|
||||||
/* Reserve memory for the HCCA. */
|
/* Reserve memory for the HCCA. */
|
||||||
o->hcca = (struct grub_ohci_hcca *) grub_memalign (256, 256);
|
o->hcca = (struct grub_ohci_hcca *) grub_memalign (256, 256);
|
||||||
|
@ -181,7 +178,7 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, frame_interval);
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, frame_interval);
|
||||||
|
|
||||||
/* Setup the HCCA. */
|
/* Setup the HCCA. */
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, vtop ((grub_uint32_t) o->hcca));
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca);
|
||||||
grub_dprintf ("ohci", "OHCI HCCA\n");
|
grub_dprintf ("ohci", "OHCI HCCA\n");
|
||||||
|
|
||||||
/* Enable the OHCI. */
|
/* Enable the OHCI. */
|
||||||
|
@ -267,10 +264,10 @@ grub_ohci_transaction (grub_ohci_td_t td,
|
||||||
buffer = (grub_uint32_t) data;
|
buffer = (grub_uint32_t) data;
|
||||||
buffer_end = buffer + size - 1;
|
buffer_end = buffer + size - 1;
|
||||||
|
|
||||||
td->token = grub_cpu_to_le32 (vtop (token));
|
td->token = grub_cpu_to_le32 (token);
|
||||||
td->buffer = grub_cpu_to_le32 (vtop (buffer));
|
td->buffer = grub_cpu_to_le32 (buffer);
|
||||||
td->next_td = 0;
|
td->next_td = 0;
|
||||||
td->buffer_end = grub_cpu_to_le32 (vtop (buffer_end));
|
td->buffer_end = grub_cpu_to_le32 (buffer_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
static grub_usb_err_t
|
static grub_usb_err_t
|
||||||
|
@ -310,8 +307,7 @@ grub_ohci_transfer (grub_usb_controller_t dev,
|
||||||
grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle,
|
grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle,
|
||||||
tr->size, tr->data);
|
tr->size, tr->data);
|
||||||
|
|
||||||
td_list[i].next_td = grub_cpu_to_le32 (vtop ((grub_addr_t)
|
td_list[i].next_td = grub_cpu_to_le32 (&td_list[i + 1]);
|
||||||
&td_list[i + 1]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup the Endpoint Descriptor. */
|
/* Setup the Endpoint Descriptor. */
|
||||||
|
@ -328,9 +324,9 @@ grub_ohci_transfer (grub_usb_controller_t dev,
|
||||||
/* Set the maximum packet size. */
|
/* Set the maximum packet size. */
|
||||||
target |= transfer->max << 16;
|
target |= transfer->max << 16;
|
||||||
|
|
||||||
td_head = vtop ((grub_uint32_t) td_list);
|
td_head = (grub_uint32_t) td_list;
|
||||||
|
|
||||||
td_tail = vtop ((grub_uint32_t) &td_list[transfer->transcnt]);
|
td_tail = (grub_uint32_t) &td_list[transfer->transcnt];
|
||||||
|
|
||||||
ed->target = grub_cpu_to_le32 (target);
|
ed->target = grub_cpu_to_le32 (target);
|
||||||
ed->td_head = grub_cpu_to_le32 (td_head);
|
ed->td_head = grub_cpu_to_le32 (td_head);
|
||||||
|
@ -357,8 +353,7 @@ grub_ohci_transfer (grub_usb_controller_t dev,
|
||||||
status &= ~(1 << 2);
|
status &= ~(1 << 2);
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status);
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status);
|
||||||
|
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD,
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, (grub_uint32_t) ed);
|
||||||
vtop ((grub_uint32_t) ed));
|
|
||||||
|
|
||||||
/* Enable the Bulk list. */
|
/* Enable the Bulk list. */
|
||||||
control |= 1 << 5;
|
control |= 1 << 5;
|
||||||
|
@ -386,9 +381,9 @@ grub_ohci_transfer (grub_usb_controller_t dev,
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status);
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status);
|
||||||
|
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD,
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD,
|
||||||
vtop ((grub_uint32_t) ed));
|
(grub_uint32_t) ed);
|
||||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD+1,
|
grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD+1,
|
||||||
vtop ((grub_uint32_t) ed));
|
(grub_uint32_t) ed);
|
||||||
|
|
||||||
/* Enable the Control list. */
|
/* Enable the Control list. */
|
||||||
control |= 1 << 4;
|
control |= 1 << 4;
|
||||||
|
|
|
@ -29,36 +29,6 @@ lspci_mod_SOURCES = commands/lspci.c
|
||||||
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
|
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
# For ohci.mod
|
|
||||||
pkglib_MODULES += ohci.mod
|
|
||||||
ohci_mod_SOURCES = bus/usb/ohci.c
|
|
||||||
ohci_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
ohci_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For usb.mod
|
|
||||||
pkglib_MODULES += usb.mod
|
|
||||||
usb_mod_SOURCES = bus/usb/usb.c bus/usb/usbtrans.c bus/usb/usbhub.c
|
|
||||||
usb_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
usb_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For usbtest.mod
|
|
||||||
pkglib_MODULES += usbtest.mod
|
|
||||||
usbtest_mod_SOURCES = commands/usbtest.c
|
|
||||||
usbtest_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
usbtest_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For usbms.mod
|
|
||||||
pkglib_MODULES += usbms.mod
|
|
||||||
usbms_mod_SOURCES = disk/usbms.c
|
|
||||||
usbms_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
usbms_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For usb_keyboard.mod
|
|
||||||
pkglib_MODULES += usb_keyboard.mod
|
|
||||||
usb_keyboard_mod_SOURCES = term/usb_keyboard.c
|
|
||||||
usb_keyboard_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
usb_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For at_keyboard.mod.
|
# For at_keyboard.mod.
|
||||||
pkglib_MODULES += at_keyboard.mod
|
pkglib_MODULES += at_keyboard.mod
|
||||||
at_keyboard_mod_SOURCES = term/at_keyboard.c
|
at_keyboard_mod_SOURCES = term/at_keyboard.c
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/term.h>
|
#include <grub/term.h>
|
||||||
|
#include <grub/machine/console.h>
|
||||||
#include <grub/time.h>
|
#include <grub/time.h>
|
||||||
#include <grub/cpu/io.h>
|
#include <grub/cpu/io.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
|
|
Loading…
Reference in a new issue