blob: 3e7d1e9f460f197cb73c01d6d6cc1ae4b06812ce [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001Introduction:
2=============
3
4The msm_rng device driver handles random number generation
5using hardware present in MSM chipsets.
6
7Hardware description:
8=====================
9
10The supported hardware is a macro block within a system-on-a-chip (SoC).
11The hardware is pseudo random number generator (PRNG) with four oscillators
12setup with a linear feedback shift register (LFSR).
13The hardware must be initially configured once for normal operation and
14a 32bit FIFO is read to obtain hardware generated pseudo random numbers.
15Currently the driver configures the hardware registers during initialization
16and the future plan is to have the boot loader configure these registers and
17write lock them so only host OS can read them and the driver writes will be
18ignored.
19
20Software description
21====================
22
23The driver is based on the platform_driver model. It registers an entry,
24exit and probe functions. Once the probe function is called, the driver
25registers a callback function with the hwrng (Hardware Random Number Generator)
26subsystem that is called when the hardware device (i.e. /dev/hw_random) is
27requesting random data from this device.
28Once the callback is issued from the hwrng subsystem, the driver checks to
29make sure the hardware has random data available and determines the maximum
30data it can return and returns that much data back.
31
32Power Management
33================
34
35Initially, no services are provided in the area of power management.
36
37SMP/multi-core
38==============
39
40The locking mechanism for the hwrng operations is taken care of by the hwrng
41framework. There are no SMP situations within the driver that need addressing.
42
43Driver parameters
44=================
45
46This driver is built and statically linked into the kernel; therefore,
47there are no module parameters supported by this driver.
48
49There are no kernel command line parameters supported by this driver.
50
51Config options
52==============
53
54This driver is enabled by the kernel config option CONFIG_HW_RANDOM_MSM.
55The option CONFIG_HW_RANDOM_MSM depends on HW_RANDOM && ARCH_MSM.
56
57Dependencies:
58=============
59
60This driver depends on the HW_RANDOM subsystem to register with and get
61callbacks to request random data.
62
63User space utilities:
64=====================
65
66The driver alone does not feed random numbers into kernel but just provides a
67method to get random numbers to a known device (i.e. /dev/hw_random). A user-
68space utility is required to monitor the /dev/random device entropy pool and
69feed it from the /dev/hw_random device. This application also must perform some
70sort of sanity checking on the returned data to make sure the data is not all
71the same.
72
73There is currently a GPL v2 tool called rng-tools that has a daemon called,
74"rngd" that performs this functionality. There is also a test tool in this
75package that tests the whole random subsystem.