Remove runqemu from build... document platform_device.c a bit further, add a modprobe.conf test

This commit is contained in:
Ciro Santilli
2017-11-11 11:11:06 +00:00
parent a070486855
commit 0d7259fe81
4 changed files with 21 additions and 3 deletions

1
build
View File

@@ -74,4 +74,3 @@ time \
all \
;
cd ..
./runqemu "$@"

View File

@@ -19,6 +19,14 @@ Those parameters can also be read and modified at runtime from /sys.
modinfo
/params.ko
# Output contains MODULE_PARAM_DESC descriptions.
modprobe insertion can also set default parameters via the /etc/modprobe.conf file. So:
modprobe params
Outputs:
12 34
*/
#include <linux/delay.h> /* usleep_range */

View File

@@ -1,7 +1,12 @@
/*
Only works for ARM.
Uses the hw/misc/lkmc_platform_device.c minimal device added in our QEMU fork.
Uses:
- hw/misc/lkmc_platform_device.c minimal device added in our QEMU fork
- the device tree entry we added to our Linux kernel fork:
https://github.com/cirosantilli/linux/blob/361bb623671a52a36a077a6dd45843389a687a33/arch/arm/boot/dts/versatile-pb.dts#L42
See: https://stackoverflow.com/questions/28315265/how-to-add-a-new-device-in-qemu-source-code/44612957#44612957
@@ -49,7 +54,7 @@ static int lkmc_platform_device_probe(struct platform_device *pdev)
dev_info(dev, "probe\n");
/* Play with our custom poperty. */
/* Play with our custom device tree poperty. */
if (of_property_read_u32(np, "lkmc-asdf", &asdf) ) {
dev_err(dev, "of_property_read_u32\n");
return -EINVAL;
@@ -100,6 +105,8 @@ static int lkmc_platform_device_remove(struct platform_device *pdev)
}
static const struct of_device_id of_lkmc_platform_device_match[] = {
/* This tells our driver which device tree node it will use.
* It matches the kmc_platform_device@XXXX entry that we added to the device tree. */
{ .compatible = "lkmc_platform_device", },
{},
};

View File

@@ -0,0 +1,4 @@
# Default parameters when loading modules.
# Especially important due to loading module dependencies:
# how else would you specify their parameters?
options params i=12 j=34