OpenCores
no use no use 1/1 no use no use
Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
It works!!! I can mount partition on usbstick! )) Im using Ordb2a-ep4ce22 and OpenRISC_Ubuntu_2011-12-15.vdi http://opencores.org/or1k/Ubuntu_VirtualBox-image_updates_and_information I powered usb connector http://opencores.org/forum,OpenRISC,0,4730 ~\soc-design\orpsocv2\boards\altera\ordb2a-ep4ce22\rtl\verilog\orpsoc_top\orpsoc_top.v 2315a2316,2317 > assign usb0enable_pad_o = 1'b1; //always power on > 2317,2318d2318 //if (~usb0id_pad_i == usb0_hostmode) > if (usb0_hostmode) > 2334c2336 //usb0enable_pad_o //usb0enable_pad_o //usb0enable_pad_o //#define DEBUG > //#undef DEBUG 72a73,75 > #include > #include > 77c80 #define DRIVER_VERSION "10 Sep 2013" 1447c1450 static const struct file_operations proc_ops = { 1460c1463 proc_create_data(proc_filename, 0, NULL, &proc_ops, ohs900); 1555c1558 static int ohs900h_remove(struct platform_device *dev) 1572c1575 static int ohs900h_probe(struct platform_device *pdev) 1682a1686 > pr_debug("driver %s, hw version = %d\n", hcd_name, tmp); 1702a1707,1712 > case 0x21: > hcd->product_desc = "OHS900 v2.1"; > break; > case 0x22: > hcd->product_desc = "OHS900 v2.2"; > break; 1708c1718 1789c1799 .remove = ohs900h_remove, Added the controller section to ~/soc-design/linux/arch/openrisc/boot/dts/ordb2a.dts ohs900: ocores@9c000000 {             compatible = "opencores,ohs900-ocores";             reg = ;             interrupts = ;             can_wakeup = ;             potpg = ;             power = ; }; Configured the kernel cd ~/soc-design/linux make ARCH = openrisc menuconfig [*] Enable the block layer Device Drivers     SCSI Device Support         [*] SCSI Device Support  [*] SCSI disk support Device Drivers [*]USB support         Support for Host-side USB      [*] USB announce new devices   OHS900 HCD support USB Mass Storage support File systems         DOS/FAT/NT Filesystems                 VFAT (Windows-95) fs support         Native language support                 Codepage 437 (Unated States, Canada)                 NLS ISO 8859-1 (Latin 1; Western European Languages) I follow �Program ORSoC's OpenRISC-FPGA-development-board and run Linux� from Running_SW_on_FPGA_board.txt except �make ARCH=openrisc defconfig�. Console output is in the log file
RE: Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
Linux USB drive
It works!!! I can mount partition on usbstick! ))
Im using Ordb2a-ep4ce22 and OpenRISC_Ubuntu_2011-12-15.vdi
http://opencores.org/or1k/Ubuntu_VirtualBox-image_updates_and_information

I powered usb connector
http://opencores.org/forum,OpenRISC,0,4730

~\soc-design\orpsocv2\boards\altera\ordb2a-ep4ce22\rtl\verilog\orpsoc_top\orpsoc_top.v
2315a2316,2317
> assign usb0enable_pad_o = 1'b1; //always power on
>
2317,2318d2318
2324c2324,2326
---
> //if (~usb0id_pad_i == usb0_hostmode)
> if (usb0_hostmode)
>
2334c2336
---
> //usb0enable_pad_o 2343c2345
---
> //usb0enable_pad_o 2352c2354
---
> //usb0enable_pad_o
Then I checked 5V at my usbstick
RE: Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
I Added some lines to
~/soc-design/linux/arch/openrisc/mm/ioremap.c

EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(pte_alloc_one_kernel);
RE: Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
I changed something in
~/soc-design/linux/drivers/usb/host/ohs900-hcd.c
ohs900-hcd (1 kb)
RE: Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
I added the controller section "ohs900: ocores@9c000000" to
~/soc-design/linux/arch/openrisc/boot/dts/ordb2a.dts

I copied it from
https://lkml.org/lkml/2011/6/19/51

I can't post it ( This file is in the attachement
RE: Linux USB drive
by hate2login on Sep 12, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
I configured the kernel
cd ~/soc-design/linux
make ARCH = openrisc menuconfig

[*] Enable the block layer

Device Drivers
__SCSI Device Support
_____[*] SCSI Device Support
_____[*] SCSI disk support

Device Drivers
______[*]USB support
___________[*] Support for Host-side USB
___________[*] USB announce new devices
___________[*] OHS900 HCD support
___________[*] USB Mass Storage support

File systems
____DOS/FAT/NT Filesystems
_________[*] VFAT (Windows-95) fs support
____Native language support
_____________[*] Codepage 437 (Unated States, Canada)
_____________[*] NLS ISO 8859-1 (Latin 1; Western European Languages)

I follow "Program ORSoC's OpenRISC-FPGA-development-board and run Linux" from Running_SW_on_FPGA_board.txt except "make ARCH=openrisc defconfig".
Console output is in the log file
RE: Linux USB drive
by hate2login on Sep 18, 2013
hate2login
Posts: 9
Joined: Feb 20, 2012
Last seen: Feb 5, 2024
if you need automount
1. add
sd[a-z][0-9] 0:0 660 @/lib/mdev/automount.sh
to
~/soc-design/linux/arch/openrisc/support/initramfs/etc/mdev.conf

(http://git.busybox.net/busybox/plain/docs/mdev.txt)

2. Write your script
~/soc-design/linux/arch/openrisc/support/initramfs/lib/mdev/automount.sh
for example

#!/bin/sh
device=${MDEV}
if [ ! -d /mnt/$device ]; then
mkdir /mnt/$device
fi
mount /dev/$device /mnt/$device
touch /mnt/$device/openriscWasHere
umount /mnt/$device

3. add
echo /sbin/mdev > /proc/sys/kernel/hotplug
to
~/soc-design/linux/arch/openrisc/support/initramfs/etc/init.d/rc.S

May be this it is not appropriate place for this line. I can't find where it shoud be.

You can use
mdev -s
to debug
no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.