Altera_Forum
Honored Contributor
19 years agoDeveloping USB Mass storage drivers..
Hi guys,
I'm tasked to make our FPGA board (Altera Stratix II with NiosII core w/ Microtronix uCLinux version 1.4) able to write data out to a USB hard drive (like a LaCie drive). The USB port is OTG. Currently, the driver for writing data out to the USB port has been written, but it doesn't have the mass-storage protocol yet. I was wondering where can I learn how to so (newbie to developing drivers)? We use CAST USB core. When I boot up the uCLinux, this is the message we are getting. (Just FYI ..if it provides any info about our board at all) nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB-0]", device 2, instance 3 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.11-uc0 (jeff@Andromeda) (gcc version 3.4.1 (Altera Nios II 5.1 b73))# 938 Fri Aug 11 21:23:31 EDT 2006 uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. setup_arch: No persistant network settings signature at 03FF0000 Built 1 zonelists Kernel command line: root=/dev/mtdblock3 ro PID hash table entries: 256 (order: 8, 4096 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory available: 30368k/32768k RAM, 0k/0k ROM (1709k kernel code, 316k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub comms: FPGA version: 1.2.9 JFFS2 version 2.2. (NAND) © 2001-2003 Red Hat, Inc. NIOS serial driver version 0.0 ttyS0 (irq = 10) is a builtin NIOS UART Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x87000000 (irq = 9) is a jtag_uart io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize mtip_probe:eth0, 100000 Khz Nios (VSC8211) (PIO) MoreThanIP 10/100/1000 Driver(v1.0), Linux 2.6.5 Apr2004 mtip_find_phy: found target PHY at address 2 mtip_probe:PHY reg17 = 0x1a34 mtip_probe:eth0, REV=0x00010023, (VSC8211) Phyaddr:0x02 WARNING: No MAC address found in flash at address 0x07fc0000. Using non-unique MAC address of 00:07:ed:00:00:00 ADDR: 00:07:ed:00:00:00: mtip_probe:eth1, 100000 Khz Nios (VSC8211) (PIO) Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 Altera NDK flash (AMD): CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. cmdlinepart partition parsing not available RedBoot partition parsing not available Using Altera NDK partition definition Creating 7 MTD partitions on "Altera NDK flash (AMD)": 0x00300000-0x00b00000 : "COP - romfs" 0x00000000-0x00300000 : "COP - loader/kernel" 0x00b00000-0x02000000 : "COP - jffs2" 0x02300000-0x02b00000 : "FEP - romfs" 0x02000000-0x02300000 : "FEP - loader/kernel" 0x02b00000-0x03000000 : "FEP - jffs2" 0x03000000-0x04000000 : "FPGA Code" cast_usb: driver cast-hcd, 15 Jan 2006 cast_usb: USB Host Controller, irq 0 cast_usb: USB Host Controller, irq 2 cast-hcd cast-hcd: new USB bus registered, assigned bus number 1 usb usb1: Product: USB Host Controller usb usb1: Manufacturer: uClinux 2.6.11-uc0 cast-hcd usb usb1: SerialNumber: cast-hcd hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected CASTUSB: Timeout waiting for OTG negotiation cast_hub_control: Jumper 3 installed cast_hub_control: JUMPERREG: c0060000 cast_hub_control: JUMPERREG: c0060000 Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. cast-udc-sas: loaded. cast-udc-veh: loaded. miser_sas gadget: Miser SAS, version: 15 Jan 2006 cast-udc-sas: registered gadget driver 'miser_sas' cast-udc-sas: Entered IDLE state cast-udc-sas: Entered PERIPHERAL state cast-udc-sas: Entered PERIPHERAL state miser_veh gadget: Miser VEH, version: 15 Jan 2006 cast-udc-veh: registered gadget driver 'miser_veh' cast-udc-veh: Entered IDLE state cast-udc-veh: Entered PERIPHERAL state cast-udc-veh: Entered PERIPHERAL state NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) VFS: Mounted root (romfs filesystem) readonly. Freeing unused kernel memory: 68k freed (0x41da000 - 0x41ea000) expand: from=/ramfs.img to=/dev/ram0 expand: from=/ramfs.img to=/dev/ram1 mtip_phy_configure:eth0, autoneg complete PhyCtl0: 1000 PhySts1: 796D PhyID1: 000F PhyID2: C4B1 PhyAdv4: 01E1 PhyRemcap5: 0020 mtip_phymac_synch:eth0 MR1: 0x0000796D Autoneg'd Link OK: HalfD 10BASE-T CMDCF: 0x00000603