parent
3f55f3e108
commit
bd77fd31d8
|
@ -0,0 +1,24 @@
|
|||
config HAS_OHCI
|
||||
bool
|
||||
|
||||
config USB_HOST
|
||||
bool
|
||||
|
||||
config HAS_USB_DEVICE
|
||||
bool
|
||||
|
||||
menu "USB host support"
|
||||
|
||||
config DRIVER_USB_HOST_OHCI
|
||||
bool
|
||||
depends on HAS_OHCI
|
||||
select USB_HOST
|
||||
prompt "OHCI host driver"
|
||||
|
||||
config DRIVER_USB_MASS_STORAGE
|
||||
bool
|
||||
depends on USB_HOST
|
||||
prompt "USB mass storage support"
|
||||
|
||||
endmenu
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
obj-$(CONFIG_USB_HOST) += host/
|
||||
#obj-$(CONFIG_USB_DEVICE) += device/
|
||||
obj-$(CONFIG_DRIVER_USB_MASS_STORAGE) += usb_storage.o
|
||||
obj-$(CONFIG_USB_HOST) += cmd_usb.o
|
||||
obj-$(CONFIG_USB_HOST) += usb.o
|
|
@ -29,11 +29,9 @@
|
|||
#include <command.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
|
||||
#include <usb.h>
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
static int usb_stor_curr_dev=-1; /* current device */
|
||||
#endif
|
||||
|
||||
|
@ -307,7 +305,7 @@ void usb_show_tree(struct usb_device *dev)
|
|||
/******************************************************************************
|
||||
* usb boot command intepreter. Derived from diskboot
|
||||
*/
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
{
|
||||
char *boot_device = NULL;
|
||||
|
@ -359,7 +357,10 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
}
|
||||
part = simple_strtoul(++ep, NULL, 16);
|
||||
}
|
||||
|
||||
#warning get_partition_info missing
|
||||
#if 1
|
||||
printf("call get_partition_info\n");
|
||||
#else
|
||||
if (get_partition_info (stor_dev, part, &info)) {
|
||||
/* try to boot raw .... */
|
||||
strncpy((char *)&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE));
|
||||
|
@ -369,6 +370,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
info.size=2880;
|
||||
printf("error reading partinfo...try to boot raw\n");
|
||||
}
|
||||
#endif
|
||||
if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
|
||||
(strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
|
||||
printf ("\n** Invalid partition type \"%.32s\""
|
||||
|
@ -423,7 +425,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_USB_STORAGE */
|
||||
#endif /* CONFIG_DRIVER_USB_MASS_STORAGE */
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
|
@ -435,7 +437,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
int i;
|
||||
struct usb_device *dev = NULL;
|
||||
extern char usb_started;
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
block_dev_desc_t *stor_dev;
|
||||
#endif
|
||||
|
||||
|
@ -444,7 +446,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
usb_stop();
|
||||
printf("(Re)start USB...\n");
|
||||
i = usb_init();
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
/* try to recognize storage devices immediately */
|
||||
if (i >= 0)
|
||||
usb_stor_curr_dev = usb_stor_scan(1);
|
||||
|
@ -512,7 +514,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
if (strncmp(argv[1], "scan", 4) == 0) {
|
||||
printf(" NOTE: this command is obsolete and will be phased out\n");
|
||||
printf(" please use 'usb storage' for USB storage devices information\n\n");
|
||||
|
@ -534,7 +536,9 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
if (devno)
|
||||
printf("\n");
|
||||
printf("print_part of %x\n",devno);
|
||||
print_part(stor_dev);
|
||||
#warning print_part missing
|
||||
printf("call print_part\n");
|
||||
// print_part(stor_dev);
|
||||
}
|
||||
}
|
||||
if (!ok) {
|
||||
|
@ -573,7 +577,9 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
}
|
||||
printf ("\n Device %d: ", dev);
|
||||
stor_dev=usb_stor_get_dev(dev);
|
||||
dev_print(stor_dev);
|
||||
#warning dev_print missing
|
||||
printf("call dev_print\n");
|
||||
// dev_print(stor_dev);
|
||||
if (stor_dev->type == DEV_TYPE_UNKNOWN) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -584,7 +590,9 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
else {
|
||||
printf ("\nUSB device %d: ", usb_stor_curr_dev);
|
||||
stor_dev=usb_stor_get_dev(usb_stor_curr_dev);
|
||||
dev_print(stor_dev);
|
||||
#warning dev_print missing
|
||||
printf("call dev_print\n");
|
||||
// dev_print(stor_dev);
|
||||
if (stor_dev->type == DEV_TYPE_UNKNOWN) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -592,18 +600,12 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_USB_STORAGE */
|
||||
#endif /* CONFIG_DRIVER_USB_MASS_STORAGE */
|
||||
printf ("Usage:\n%s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
#ifdef CONFIG_DRIVER_USB_MASS_STORAGE
|
||||
U_BOOT_CMD(
|
||||
usb, 5, 1, do_usb,
|
||||
"usb - USB sub-system\n",
|
||||
|
@ -634,4 +636,4 @@ U_BOOT_CMD(
|
|||
"usb info [dev] - show available USB devices\n"
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
obj-$(CONFIG_DRIVER_USB_HOST_OHCI) += usb_ohci.o
|
|
@ -43,8 +43,6 @@
|
|||
#include <common.h>
|
||||
/* #include <pci.h> no PCI on the S3C24X0 */
|
||||
|
||||
#ifdef CONFIG_USB_OHCI_NEW
|
||||
|
||||
/* mk: are these really required? */
|
||||
#if defined(CONFIG_S3C2400)
|
||||
# include <s3c2400.h>
|
||||
|
@ -84,7 +82,7 @@
|
|||
|
||||
#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG
|
||||
#ifdef DEBUG
|
||||
#define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
|
||||
#else
|
||||
|
@ -877,7 +875,7 @@ static int dl_done_list (ohci_t *ohci, td_t *td_list)
|
|||
/* see if this done list makes for all TD's of current URB,
|
||||
* and mark the URB finished if so */
|
||||
if (++(lurb_priv->td_cnt) == lurb_priv->length) {
|
||||
#if 1
|
||||
#if 0
|
||||
if ((ed->state & (ED_OPER | ED_UNLINK)) &&
|
||||
(lurb_priv->state != URB_DEL))
|
||||
#else
|
||||
|
@ -889,6 +887,7 @@ static int dl_done_list (ohci_t *ohci, td_t *td_list)
|
|||
dbg("dl_done_list: processing TD %x, len %x\n", lurb_priv->td_cnt,
|
||||
lurb_priv->length);
|
||||
#endif
|
||||
|
||||
if (ed->state != ED_NEW) {
|
||||
edHeadP = m32_swap (ed->hwHeadP) & 0xfffffff0;
|
||||
edTailP = m32_swap (ed->hwTailP);
|
||||
|
@ -1635,6 +1634,11 @@ static char ohci_inited = 0;
|
|||
int usb_lowlevel_init(void)
|
||||
{
|
||||
|
||||
/* FIXME */
|
||||
/* Enable USB host clock. */
|
||||
*AT91C_PMC_SCER = AT91C_PMC_UHP; /* 48MHz clock enabled for UHP */
|
||||
*AT91C_PMC_PCER = 1 << AT91C_ID_UHP; /* Peripheral Clock Enable Register */
|
||||
|
||||
#ifdef CFG_USB_OHCI_CPU_INIT
|
||||
/* cpu dependant init */
|
||||
if(usb_cpu_init())
|
||||
|
@ -1746,4 +1750,4 @@ int usb_lowlevel_stop(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_USB_OHCI_NEW */
|
||||
|
||||
|
|
|
@ -49,8 +49,6 @@
|
|||
#include <asm/processor.h>
|
||||
#include <linux/ctype.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
|
||||
#include <usb.h>
|
||||
#ifdef CONFIG_4xx
|
||||
#include <405gp_pci.h>
|
||||
|
@ -727,7 +725,7 @@ int usb_new_device(struct usb_device *dev)
|
|||
addr = dev->devnum;
|
||||
dev->devnum = 0;
|
||||
|
||||
#undef NEW_INIT_SEQ
|
||||
#define NEW_INIT_SEQ
|
||||
#ifdef NEW_INIT_SEQ
|
||||
/* this is a Windows scheme of initialization sequence, with double
|
||||
* reset of the device. Some equipment is said to work only with such
|
||||
|
@ -961,7 +959,7 @@ struct usb_hub_device *usb_hub_allocate(void)
|
|||
|
||||
#define MAX_TRIES 5
|
||||
|
||||
static int hub_port_reset(struct usb_device *dev, int port,
|
||||
int hub_port_reset(struct usb_device *dev, int port,
|
||||
unsigned short *portstat)
|
||||
{
|
||||
int tries;
|
||||
|
@ -1247,6 +1245,3 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#endif /* (CONFIG_COMMANDS & CFG_CMD_USB) */
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -55,11 +55,8 @@
|
|||
#include <asm/processor.h>
|
||||
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
#include <usb.h>
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
|
||||
#undef USB_STOR_DEBUG
|
||||
#undef BBB_COMDAT_TRACE
|
||||
#undef BBB_XPORT_TRACE
|
||||
|
@ -194,7 +191,9 @@ void usb_stor_info(void)
|
|||
if (usb_max_devs > 0)
|
||||
for (i = 0; i < usb_max_devs; i++) {
|
||||
printf (" Device %d: ", i);
|
||||
dev_print(&usb_dev_desc[i]);
|
||||
#warning dev_print missing
|
||||
printf("call dev_print\n");
|
||||
// dev_print(&usb_dev_desc[i]);
|
||||
}
|
||||
else
|
||||
printf("No storage devices, perhaps not 'usb start'ed..?\n");
|
||||
|
@ -1228,11 +1227,11 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
|
|||
USB_STOR_PRINTF(" address %d\n",dev_desc->target);
|
||||
USB_STOR_PRINTF("partype: %d\n",dev_desc->part_type);
|
||||
|
||||
init_part(dev_desc);
|
||||
printf("init_part\n");
|
||||
#warning init_part missing
|
||||
// init_part(dev_desc);
|
||||
|
||||
USB_STOR_PRINTF("partype: %d\n",dev_desc->part_type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USB_STORAGE */
|
||||
#endif /* CFG_CMD_USB */
|
||||
|
|
Loading…
Reference in New Issue