summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2020-02-06 12:54:45 -0800
committerRoman Kiryanov <rkir@google.com>2020-02-11 00:09:53 -0800
commit84e5503e6c48fdd3e99690367c4254a962fd9c39 (patch)
tree01d94b0c56e781ecdf212ea7d4acebaf1686f7a7
parentfc395e29714433774fcb63b611d23201cf650034 (diff)
downloadgoldfish-modules-84e5503e6c48fdd3e99690367c4254a962fd9c39.tar.gz
Add standard kernel options required by goldfish as modules
The kernel with goldfish modules boots on the emulator, adb works. Bug: 147493341 Test: boot Change-Id: If406f720a1eaa220203c6a262e338dc78514e1db Signed-off-by: Roman Kiryanov <rkir@google.com>
-rw-r--r--Kbuild1
-rw-r--r--build.config.goldfish2
-rw-r--r--build.config.goldfish.aarch645
-rw-r--r--build.config.goldfish.x86_645
-rw-r--r--goldfish_cpufreq_stats.c83
-rw-r--r--goldfish_defconfig.fragment17
6 files changed, 28 insertions, 85 deletions
diff --git a/Kbuild b/Kbuild
index 3809c95..bb5aef0 100644
--- a/Kbuild
+++ b/Kbuild
@@ -4,5 +4,4 @@ obj-m += goldfish_pipe.o
obj-m += goldfish_sync.o
obj-m += goldfish_address_space.o
obj-m += goldfish_battery.o
-obj-m += goldfish_cpufreq_stats.o
obj-m += goldfish_rotary.o
diff --git a/build.config.goldfish b/build.config.goldfish
index 77aff12..21f8625 100644
--- a/build.config.goldfish
+++ b/build.config.goldfish
@@ -1,2 +1,2 @@
-BUILD_INITRAMFS=1
EXT_MODULES="goldfish-modules"
+FRAGMENT_DEFCONFIG_PATH="${ROOT_DIR}/goldfish-modules/goldfish_defconfig.fragment"
diff --git a/build.config.goldfish.aarch64 b/build.config.goldfish.aarch64
index 534643b..df9efdd 100644
--- a/build.config.goldfish.aarch64
+++ b/build.config.goldfish.aarch64
@@ -1,2 +1,7 @@
. ${ROOT_DIR}/common/build.config.gki.aarch64
. ${ROOT_DIR}/goldfish-modules/build.config.goldfish
+
+DEFCONFIG=goldfish_aarch64_defconfig
+DEFCONFIG_PATH="${ROOT_DIR}/common/arch/arm64/configs"
+PRE_DEFCONFIG_CMDS="cat ${DEFCONFIG_PATH}/gki_defconfig ${FRAGMENT_DEFCONFIG_PATH} > ${DEFCONFIG_PATH}/${DEFCONFIG};"
+POST_DEFCONFIG_CMDS="rm ${DEFCONFIG_PATH}/${DEFCONFIG}"
diff --git a/build.config.goldfish.x86_64 b/build.config.goldfish.x86_64
index 91792de..fe899ae 100644
--- a/build.config.goldfish.x86_64
+++ b/build.config.goldfish.x86_64
@@ -1,2 +1,7 @@
. ${ROOT_DIR}/common/build.config.gki.x86_64
. ${ROOT_DIR}/goldfish-modules/build.config.goldfish
+
+DEFCONFIG=goldfish_86_64_defconfig
+DEFCONFIG_PATH="${ROOT_DIR}/common/arch/x86/configs"
+PRE_DEFCONFIG_CMDS="cat ${DEFCONFIG_PATH}/gki_defconfig ${FRAGMENT_DEFCONFIG_PATH} > ${DEFCONFIG_PATH}/${DEFCONFIG};"
+POST_DEFCONFIG_CMDS="rm ${DEFCONFIG_PATH}/${DEFCONFIG}"
diff --git a/goldfish_cpufreq_stats.c b/goldfish_cpufreq_stats.c
deleted file mode 100644
index 383f3e7..0000000
--- a/goldfish_cpufreq_stats.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * drivers/cpufreq/cpufreq_stats.c
- *
- * Copyright (C) 2003-2004 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
- * (C) 2004 Zou Nan hai <nanhai.zou@intel.com>.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/cpu.h>
-#include <linux/cpufreq.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-
-#define to_attr(a) container_of(a, struct freq_attr, attr)
-
-static unsigned long long fake_time;
-
-static DEFINE_PER_CPU(struct kobject *, cpufreq_kobj);
-
-static ssize_t time_in_state_show(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
-{
- ssize_t len = 0;
-
- len = sprintf(buf, "%lu %llu\n", 3000000000, ++fake_time);
- return len;
-}
-
-static struct kobj_attribute time_in_state =
- __ATTR_RO_MODE(time_in_state, 0444);
-
-static struct attribute *cpufreq_stats_attrs[] = {
- &time_in_state.attr,
- NULL
-};
-static struct attribute_group stats_attr_group = {
- .attrs = cpufreq_stats_attrs,
- .name = "stats"
-};
-
-static void cpufreq_stats_free(unsigned int cpu)
-{
- struct device *dev = get_cpu_device(cpu);
- struct kobject **kobj = &per_cpu(cpufreq_kobj, cpu);
-
- sysfs_remove_group(&dev->kobj, &stats_attr_group);
- kobject_put(*kobj);
- *kobj=NULL;
-}
-
-static void cpufreq_stats_create(unsigned int cpu)
-{
- int ret;
- struct device *dev = get_cpu_device(cpu);
- struct kobject **kobj = &per_cpu(cpufreq_kobj, cpu);
-
- *kobj = kobject_create_and_add("cpufreq", &dev->kobj);
- ret = sysfs_create_group(*kobj, &stats_attr_group);
-}
-
-static int __init goldfish_cpufreq_stats_init(void)
-{
- unsigned int cpu;
-
- for_each_online_cpu(cpu)
- cpufreq_stats_create(cpu);
-
- return 0;
-}
-
-static void __exit goldfish_cpufreq_stats_exit(void)
-{
- unsigned int cpu;
-
- for_each_online_cpu(cpu)
- cpufreq_stats_free(cpu);
-}
-
-module_init(goldfish_cpufreq_stats_init);
-module_exit(goldfish_cpufreq_stats_exit);
diff --git a/goldfish_defconfig.fragment b/goldfish_defconfig.fragment
new file mode 100644
index 0000000..d311309
--- /dev/null
+++ b/goldfish_defconfig.fragment
@@ -0,0 +1,17 @@
+CONFIG_BLK_DEV_MD=y
+CONFIG_DM_MIRROR=y
+CONFIG_DM_ZERO=y
+CONFIG_DRM_VIRTIO_GPU=y
+CONFIG_HW_RANDOM_VIRTIO=y
+CONFIG_MAC80211_HWSIM=y
+CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SND_INTEL8X0=y
+CONFIG_USB_DUMMY_HCD=y
+CONFIG_VETH=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_VIRTIO_INPUT=y
+CONFIG_VIRTIO_NET=y
+CONFIG_VIRTIO_PCI=y
+