Merge branch 'master' into usbkb_sauter
authorBernhard Urban <lewurm@gmx.net>
Wed, 23 Sep 2009 15:42:23 +0000 (17:42 +0200)
committerBernhard Urban <lewurm@gmx.net>
Wed, 23 Sep 2009 15:42:23 +0000 (17:42 +0200)
Conflicts:
Makefile
gecko.c
hollywood.h
main.c

1  2 
Makefile
hollywood.h
main.c

diff --cc Makefile
index 98118622caf38de90946a189b7d06aef8f676451,39a27fff227c54c5f16c3183b8ba11d32ee64475..a7d144b9fabeee99e180e4fb441dd55fe62fbb20
+++ b/Makefile
@@@ -9,9 -9,7 +9,9 @@@ TARGET = ppcboot.el
  OBJS = realmode.o crt0.o main.o string.o sync.o time.o printf.o input.o \
        exception.o exception_2200.o malloc.o gecko.o video_low.o \
        ipc.o mini_ipc.o nandfs.o ff.o diskio.o fat.o font.o console.o \
-       irq.o
 -      sha1.o
++      irq.o sha1.o
 +
 +include usb/Makefile
  
  include common.mk
  
diff --cc hollywood.h
index 9133116e8f1e3ea3326fefc6bbcb5236445b298a,3f2dde48eb0ee7a0b0d0d6d3c9574882a29b78e0..e957e99cc67c44dbaeeafe3f3b6a6209230d5abb
@@@ -140,41 -140,67 +140,40 @@@ Copyright (C) 2008, 2009        John Kelley <w
  #define               SDHC_REG_BASE           0xd070000
  
  /* OHCI0 Registers */
 -
  #define       OHCI0_REG_BASE          0xd050000
  
 -#define       OHCI0_HC_REVISION                       (OHCI0_REG_BASE + 0x00)
 -#define       OHCI0_HC_CONTROL                        (OHCI0_REG_BASE + 0x04)
 -#define       OHCI0_HC_COMMAND_STATUS         (OHCI0_REG_BASE + 0x08)
 -#define       OHCI0_HC_INT_STATUS             (OHCI0_REG_BASE + 0x0C)
 -
 -#define       OHCI0_HC_INT_ENABLE             (OHCI0_REG_BASE + 0x10)
 -#define       OHCI0_HC_INT_DISABLE            (OHCI0_REG_BASE + 0x14)
 -#define       OHCI0_HC_HCCA                           (OHCI0_REG_BASE + 0x18)
 -#define       OHCI0_HC_PERIOD_CURRENT_ED      (OHCI0_REG_BASE + 0x1C)
 -
 -#define       OHCI0_HC_CTRL_HEAD_ED           (OHCI0_REG_BASE + 0x20)
 -#define       OHCI0_HC_CTRL_CURRENT_ED        (OHCI0_REG_BASE + 0x24)
 -#define       OHCI0_HC_BULK_HEAD_ED           (OHCI0_REG_BASE + 0x28)
 -#define       OHCI0_HC_BULK_CURRENT_ED        (OHCI0_REG_BASE + 0x2C)
 -
 -#define       OHCI0_HC_DONE_HEAD                      (OHCI0_REG_BASE + 0x30)
 -#define       OHCI0_HC_FM_INTERVAL            (OHCI0_REG_BASE + 0x34)
 -#define       OHCI0_HC_FM_REMAINING           (OHCI0_REG_BASE + 0x38)
 -#define       OHCI0_HC_FM_NUMBER                      (OHCI0_REG_BASE + 0x3C)
 -
 -#define       OHCI0_HC_PERIODIC_START         (OHCI0_REG_BASE + 0x40)
 -#define       OHCI0_HC_LS_THRESHOLD           (OHCI0_REG_BASE + 0x44)
 -#define       OHCI0_HC_RH_DESCRIPTOR_A        (OHCI0_REG_BASE + 0x48)
 -#define       OHCI0_HC_RH_DESCRIPTOR_B        (OHCI0_REG_BASE + 0x4C)
 -
 -#define       OHCI0_HC_RH_STATUS                      (OHCI0_REG_BASE + 0x50)
 -
  /* OHCI1 Registers */
 -
  #define       OHCI1_REG_BASE          0xd060000
  
 -#define       OHCI1_HC_REVISION                       (OHCI1_REG_BASE + 0x00)
 -#define       OHCI1_HC_CONTROL                        (OHCI1_REG_BASE + 0x04)
 -#define       OHCI1_HC_COMMAND_STATUS         (OHCI1_REG_BASE + 0x08)
 -#define       OHCI1_HC_INT_STATUS             (OHCI1_REG_BASE + 0x0C)
 -
 -#define       OHCI1_HC_INT_ENABLE             (OHCI1_REG_BASE + 0x10)
 -#define       OHCI1_HC_INT_DISABLE            (OHCI1_REG_BASE + 0x14)
 -#define       OHCI1_HC_HCCA                           (OHCI1_REG_BASE + 0x18)
 -#define       OHCI1_HC_PERIOD_CURRENT_ED      (OHCI1_REG_BASE + 0x1C)
 -
 -#define       OHCI1_HC_CTRL_HEAD_ED           (OHCI1_REG_BASE + 0x20)
 -#define       OHCI1_HC_CTRL_CURRENT_ED        (OHCI1_REG_BASE + 0x24)
 -#define       OHCI1_HC_BULK_HEAD_ED           (OHCI1_REG_BASE + 0x28)
 -#define       OHCI1_HC_BULK_CURRENT_ED        (OHCI1_REG_BASE + 0x2C)
 -
 -#define       OHCI1_HC_DONE_HEAD                      (OHCI1_REG_BASE + 0x30)
 -#define       OHCI1_HC_FM_INTERVAL            (OHCI1_REG_BASE + 0x34)
 -#define       OHCI1_HC_FM_REMAINING           (OHCI1_REG_BASE + 0x38)
 -#define       OHCI1_HC_FM_NUMBER                      (OHCI1_REG_BASE + 0x3C)
 -
 -#define       OHCI1_HC_PERIODIC_START         (OHCI1_REG_BASE + 0x40)
 -#define       OHCI1_HC_LS_THRESHOLD           (OHCI1_REG_BASE + 0x44)
 -#define       OHCI1_HC_RH_DESCRIPTOR_A        (OHCI1_REG_BASE + 0x48)
 -#define       OHCI1_HC_RH_DESCRIPTOR_B        (OHCI1_REG_BASE + 0x4C)
 -
 -#define       OHCI1_HC_RH_STATUS                      (OHCI1_REG_BASE + 0x50)
 +#define       OHCI_HC_REVISION                        0x00
 +#define       OHCI_HC_CONTROL                         0x04
 +#define       OHCI_HC_COMMAND_STATUS          0x08
 +#define       OHCI_HC_INT_STATUS                      0x0C
 +
 +#define       OHCI_HC_INT_ENABLE                      0x10
 +#define       OHCI_HC_INT_DISABLE             0x14
 +#define       OHCI_HC_HCCA                            0x18
 +#define       OHCI_HC_PERIOD_CURRENT_ED       0x1C
 +
 +#define       OHCI_HC_CTRL_HEAD_ED            0x20
 +#define       OHCI_HC_CTRL_CURRENT_ED         0x24
 +#define       OHCI_HC_BULK_HEAD_ED            0x28
 +#define       OHCI_HC_BULK_CURRENT_ED         0x2C
 +
 +#define       OHCI_HC_DONE_HEAD                       0x30
 +#define       OHCI_HC_FM_INTERVAL             0x34
 +#define       OHCI_HC_FM_REMAINING            0x38
 +#define       OHCI_HC_FM_NUMBER                       0x3C
 +
 +#define       OHCI_HC_PERIODIC_START          0x40
 +#define       OHCI_HC_LS_THRESHOLD            0x44
 +#define       OHCI_HC_RH_DESCRIPTOR_A         0x48
 +#define       OHCI_HC_RH_DESCRIPTOR_B         0x4C
 +
 +#define       OHCI_HC_RH_STATUS                       0x50
 +#define       OHCI_HC_RH_PORT_STATUS_1        0x54
 +#define       OHCI_HC_RH_PORT_STATUS_2        0x58
  
  /* EHCI Registers */
  #define       EHCI_REG_BASE           0xd040000
  
diff --cc main.c
index dcc2f19b3bdbae5deb1669ecdc9a8e8eb75b6796,3e186f3f13505102362c6a0baa1af280907f7792..451b87dba0a95145ca920c0b972d0ba88ca8d9ef
--- 1/main.c
--- 2/main.c
+++ b/main.c
@@@ -24,9 -24,7 +24,10 @@@ Copyright (C) 2009              John Ke
  #include "video_low.h"
  #include "input.h"
  #include "console.h"
 +#include "irq.h"
 +#include "usb/core/core.h"
 +#include "usb/drivers/class/hid.h"
+ #include "sha1.h"
  #include "hollywood.h"
  
  #define MINIMUM_MINI_VERSION 0x00010001
@@@ -118,50 -111,12 +119,58 @@@ int main(void
                        ; // better ideas welcome!
        }
  
 +      /* external ohci */
 +      usb_init(OHCI0_REG_BASE);
 +
 +      /* internal ohci */
 +      //usb_init(OHCI1_REG_BASE);
 +
 +      /* load HID keyboard driver */
 +      usb_hidkb_init();
 +
 +      /* you are welcome to make this nice :) */
 +      char str[7];
 +      u16 i, j, y=20, x=20;
 +      struct kbrep *k;
 +
 +      while(1) {
 +              memset(str, '\0', 8);
 +              j=0;
 +              k = usb_hidkb_getChars();
 +              for(i=0; k->keys[i]>0; i++) {
 +                      if(x>650) {
 +                              x = 20;
 +                              y += 15;
 +                      }
 +                      if(y>440) {
 +                              y=20;
 +                      }
 +                      if((k->keys[i] >= 4) && k->keys[i] <= 4+'z'-'a') {
 +                              str[j] = k->keys[i] - 4 + 'a';
 +                      } 
 +                      else if (k->keys[i] == 0x28) {
 +                              y += 15;
 +                              x = 20;
 +                      }
 +                      j++;
 +              }
 +              if(j > 0) {
 +                      print_str_noscroll(x, y, str);
 +                      printf("y: %d\n", y);
 +              }
 +              while(j--) {
 +                      x += 13;
 +              }
 +      }
 +
++#if 0
+       printf("===============================\n");
+       SHA1TestCases();
+       printf("bye, world!\n");
++#endif
        return 0;
  }