Skip to content

Commit

Permalink
xtensa: ISS: add host file-based simulated disk
Browse files Browse the repository at this point in the history
Simdisk is a block device that maps to a file in the host file system.
It is usable for testing in the simulated environment, like xt-sim or
QEMU. Device binding to host file may be changed at runtime via proc
interface provided the device is not in use. Number of block devices
and initial binding to host files is controlled via kernel/module
parameters, with defaults specified in the kernel configuration.

Signed-off-by: Victor Prupis <vnp@tensilica.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
  • Loading branch information
Victor Prupis authored and Chris Zankel committed Feb 24, 2013
1 parent c5a285b commit b6c7e87
Show file tree
Hide file tree
Showing 3 changed files with 412 additions and 0 deletions.
36 changes: 36 additions & 0 deletions arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,42 @@ config BUILTIN_DTB
string "DTB to build into the kernel image"
depends on OF

config BLK_DEV_SIMDISK
tristate "Host file-based simulated block device support"
default n
depends on XTENSA_PLATFORM_ISS
help
Create block devices that map to files in the host file system.
Device binding to host file may be changed at runtime via proc
interface provided the device is not in use.

config BLK_DEV_SIMDISK_COUNT
int "Number of host file-based simulated block devices"
range 1 10
depends on BLK_DEV_SIMDISK
default 2
help
This is the default minimal number of created block devices.
Kernel/module parameter 'simdisk_count' may be used to change this
value at runtime. More file names (but no more than 10) may be
specified as parameters, simdisk_count grows accordingly.

config SIMDISK0_FILENAME
string "Host filename for the first simulated device"
depends on BLK_DEV_SIMDISK = y
default ""
help
Attach a first simdisk to a host file. Conventionally, this file
contains a root file system.

config SIMDISK1_FILENAME
string "Host filename for the second simulated device"
depends on BLK_DEV_SIMDISK = y && BLK_DEV_SIMDISK_COUNT != 1
default ""
help
Another simulated disk in a host file for a buildroot-independent
storage.

source "mm/Kconfig"

source "drivers/pcmcia/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/platforms/iss/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

obj-y = console.o setup.o
obj-$(CONFIG_NET) += network.o
obj-$(CONFIG_BLK_DEV_SIMDISK) += simdisk.o
Loading

0 comments on commit b6c7e87

Please sign in to comment.