]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
usb on mipsel
authorphcoder <phcoder@debian.bg45.phnet>
Mon, 19 Oct 2009 14:38:07 +0000 (16:38 +0200)
committerphcoder <phcoder@debian.bg45.phnet>
Mon, 19 Oct 2009 14:38:07 +0000 (16:38 +0200)
bus/usb/ohci.c
conf/mips.rmk
term/usb_keyboard.c

index 32fb7cf91875d6d7d200502d8c1d0a9f82487267..f131564559bfc932291bc0972a8acf673edaf076 100644 (file)
@@ -27,6 +27,8 @@
 #include <grub/i386/io.h>
 #include <grub/time.h>
 
+#define vtop(x) ((x) & 0x7fffffff)
+
 struct grub_ohci_hcca
 {
   /* Pointers to Interrupt Endpoint Descriptors.  Not used by
@@ -178,7 +180,7 @@ grub_ohci_pci_iter (int bus, int device, int func,
   grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, frame_interval);
 
   /* Setup the HCCA.  */
-  grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca);
+  grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, vtop ((grub_uint32_t) o->hcca));
   grub_dprintf ("ohci", "OHCI HCCA\n");
 
   /* Enable the OHCI.  */
@@ -264,10 +266,10 @@ grub_ohci_transaction (grub_ohci_td_t td,
   buffer = (grub_uint32_t) data;
   buffer_end = buffer + size - 1;
 
-  td->token = grub_cpu_to_le32 (token);
-  td->buffer = grub_cpu_to_le32 (buffer);
+  td->token = grub_cpu_to_le32 (vtop (token));
+  td->buffer = grub_cpu_to_le32 (vtop (buffer));
   td->next_td = 0;
-  td->buffer_end = grub_cpu_to_le32 (buffer_end);
+  td->buffer_end = grub_cpu_to_le32 (vtop (buffer_end));
 }
 
 static grub_usb_err_t
@@ -307,7 +309,7 @@ grub_ohci_transfer (grub_usb_controller_t dev,
       grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle,
                             tr->size, tr->data);
 
-      td_list[i].next_td = grub_cpu_to_le32 (&td_list[i + 1]);
+      td_list[i].next_td = grub_cpu_to_le32 (vtop (&td_list[i + 1]));
     }
 
   /* Setup the Endpoint Descriptor.  */
@@ -324,9 +326,9 @@ grub_ohci_transfer (grub_usb_controller_t dev,
   /* Set the maximum packet size.  */
   target |= transfer->max << 16;
 
-  td_head = (grub_uint32_t) td_list;
+  td_head = vtop ((grub_uint32_t) td_list);
 
-  td_tail = (grub_uint32_t) &td_list[transfer->transcnt];
+  td_tail = vtop ((grub_uint32_t) &td_list[transfer->transcnt]);
 
   ed->target = grub_cpu_to_le32 (target);
   ed->td_head = grub_cpu_to_le32 (td_head);
@@ -353,7 +355,8 @@ grub_ohci_transfer (grub_usb_controller_t dev,
        status &= ~(1 << 2);
        grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status);
 
-       grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, (grub_uint32_t) ed);
+       grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD,
+                             vtop ((grub_uint32_t) ed));
 
        /* Enable the Bulk list.  */
        control |= 1 << 5;
@@ -381,9 +384,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_CONTROLHEAD,
-                             (grub_uint32_t) ed);
+                             vtop ((grub_uint32_t) ed));
        grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD+1,
-                             (grub_uint32_t) ed);
+                             vtop ((grub_uint32_t) ed));
 
        /* Enable the Control list.  */
        control |= 1 << 4;
index 553256a9b7c1eb0da001e5efdee65c520bafaf94..f63e9bafc810ce667b481fe38edf873730b2e9b2 100644 (file)
@@ -148,6 +148,43 @@ pci_mod_SOURCES = bus/pci.c
 pci_mod_CFLAGS = $(COMMON_CFLAGS)
 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For lspci.mod
+pkglib_MODULES += lspci.mod
+lspci_mod_SOURCES = commands/lspci.c
+lspci_mod_CFLAGS = $(COMMON_CFLAGS)
+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 relocator.mod.
 pkglib_MODULES += relocator.mod
 relocator_mod_SOURCES = lib/$(target_cpu)/relocator.c lib/$(target_cpu)/relocator_asm.S
index 76b9bc3d4119ad375bc586448278e95f15cbd420..e1842e995f2e3d7fb934a18b6a202f9e1e23041d 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <grub/term.h>
 #include <grub/machine/machine.h>
-#include <grub/machine/console.h>
 #include <grub/time.h>
 #include <grub/cpu/io.h>
 #include <grub/misc.h>