linux-yocto: refactor recipes and update the kernel
cover linux-yocto: refactor recipes and update the kernel
Richard,
Consider these patches for merging. I've been building and working with these for 2 weeks now, and while they may not be perfect, they work and we need more eyes on 2.6.37.
What we get is the following:
- factoring of the code into some reusable routines in the form of a linux-yocto bbclass. The -stable, -devel and libc headers recipes are all using this common code
- A new branching scheme for the 2.6.37 kernel that generalizes the branch names and shows their hierarchy. The tools that process the kernel needed a lot of 'unlearning' about the old structure (this took a lot of my time working on this).
If this needs to be tweaked more, we can do it later, since the big changes are done and agreed on, and we can't delay scaling this out to more boards much longer.
- A -stable recipe that continues to build the 2.6.34 kernel and a move of the main recipe to track the development 2.6.37-rc5 tree. The qemu* targets have their defaults changed to 2.6.37-rc, while the hardware targets remain on 2.6.34 for a bit longer
** As discussed. The -stable naming of a recipe is
transitional and will eventually be removed and we'll switch between kernels via a different mechanism
- perf is moved into a linux-tools.inc, we can add more to this and re-use it more easily from here
- BSP boostrapping is streamlined (docs to follow).
Note: The temporary commenting of the preferred libc-headers provider was intentional. There is something strange happening when headers are generated for 2.6.34 that was breaking libc builds. To avoid holding up this series, we'll go with the default libc headers for a short while.
I've built and booted all the qemu* targets on 2.6.37 (minimal and sato), I've built most of the hardware targets. I noticed some strangeness with the mouse on ARM, and that will need to be looked at further. I've done some audits on the kernel configuration in 2.6.37, and while it looks sane, full BSP testing will tell us if anything major changed (that I missed).
If there are better suggestions on how we can stage and get mileage on this code, I'm all ears, but this is a kernel uprev, so I expect some issues (there always is even though I've done plenty of these). If we don't want anything destabilizing in the tree, I'm fine with this and we just need to come up with a plan.
What remains (I'm only one person!):
- BSP porting and full BSP testing
- Investigation into the libc-headers issue
- Continued cleanup
- Feature merging into 2.6.37 (lttng, yaffs, etc)
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: zedd/kernel
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=zedd/kernel
Thanks,
Bruce Ashfield <[email protected]>
---
Bruce Ashfield (3):
yocto-kernel: factor common routes, update to 2.6.37 and branch
renaming
linux-libc-headers-yocto: use common linux-yocto routines
qemu: update arm timer handling
meta-emenlow/conf/machine/emenlow.conf | 3 +- meta/classes/kernel-yocto.bbclass | 202 ++++++++++++++++++ .../conf/distro/include/poky-default-revisions.inc | 36 +++- meta/conf/machine/atom-pc.conf | 3 +- meta/conf/machine/beagleboard.conf | 3 +- meta/conf/machine/include/qemu.inc | 1 + meta/conf/machine/mpc8315e-rdb.conf | 3 +- meta/conf/machine/routerstationpro.conf | 3 +- .../qemu-0.12.4/arm_timer-fix-oneshot-mode.patch | 32 +++ .../arm_timer-reload-timer-when-enabled.patch | 40 ++++ meta/recipes-devtools/qemu/qemu_0.12.4.bb | 4 +- .../linux-libc-headers-yocto_git.bb | 25 +-- meta/recipes-kernel/linux/linux-tools.inc | 19 ++ .../recipes-kernel/linux/linux-yocto-stable_git.bb | 41 ++++ meta/recipes-kernel/linux/linux-yocto.inc | 23 ++ meta/recipes-kernel/linux/linux-yocto_git.bb | 219 ++------------------ 16 files changed, 420 insertions(+), 237 deletions(-) create mode 100644 meta/classes/kernel-yocto.bbclass create mode 100644 meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-fix-oneshot-mode.patch create mode 100644 meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-reload-timer-when-enabled.patch create mode 100644 meta/recipes-kernel/linux/linux-tools.inc create mode 100644 meta/recipes-kernel/linux/linux-yocto-stable_git.bb create mode 100644 meta/recipes-kernel/linux/linux-yocto.inc
PATCH 1/3 yocto-kernel: factor common routes, update to 2.6.37 and branch renaming
In order to extend and create more kernel recipes based on the supported yocto kernel common routines need to be placed in re-usable blocks.
To accomplish this meta/recipes-kernel/linux/linux-yocto_git.bb is broken into three parts:
- meta/classes/kernel-yocto.bbclass: contains common routines for checking out and configuring a yocto kernel git repository. This should be inherited by recipes that need this functionality.
- meta/recipes-kernel/linux/linux-yocto.inc: Contains the machine mappings, compatibility, build directives and common task definitions for a yocto kernel based recipe. This inherits kernel-yocto, and is the typical point of entry for other recipes.
- meta/recipes-kernel/linux/linuux-tools.inc: tasks and function definitions for kernel recipes that want to build/export perf
It also updates the linux-yocto recipe to default to 2.6.37.
As part of the update to 2.6.37 the branch naming and conventions have been modified to show inheritance, and be more generic.
For example:
master
meta
yocto/base
yocto/standard/arm_versatile_926ejs
yocto/standard/base
yocto/standard/beagleboard
yocto/standard/common_pc/atom-pc
yocto/standard/common_pc/base
yocto/standard/common_pc_64
yocto/standard/fsl-mpc8315e-rdb
yocto/standard/intel_atom_z530
yocto/standard/intel_core_qm57_pch
yocto/standard/mti_malta32_be
yocto/standard/preempt_rt/base
yocto/standard/preempt_rt/common_pc
yocto/standard/preempt_rt/common_pc_64
yocto/standard/preempt_rt/intel_atom_z530
yocto/standard/preempt_rt/intel_core_qm57_pch
yocto/standard/qemu_ppc32
yocto/standard/routerstationpro
In this structure:
master: tracks the mainline kernel
meta: meta information for the BSPs and kernel features yocto/base: baseline kernel branch yocto/standard/base: 'standard' kernel, contains features
and configs for all BSPs
yocto/standard/<machine>: represents a BSP with specific
features or configurations
The tools, tree and libc-headers have all been updated to deal with this new structure. Also in addition to dealing with the new structure, they continue to work with the existing tree and will adapt at runtime to the differences.
The linux-yocto-stable_git.bb recipe continues to build the 2.6.34 based tree,and linux-yocto_git.bb builds 2.6.37. As boards are enabled for the new kernel they will move from -stable to the development kernel. As of now, only the emulated targets have moved to 2.6.37-rcX
--- meta-emenlow/conf/machine/emenlow.conf | 3 +- meta/classes/kernel-yocto.bbclass | 202 ++++++++++++++++++ .../conf/distro/include/poky-default-revisions.inc | 36 +++- meta/conf/machine/atom-pc.conf | 3 +- meta/conf/machine/beagleboard.conf | 3 +- meta/conf/machine/include/qemu.inc | 1 + meta/conf/machine/mpc8315e-rdb.conf | 3 +- meta/conf/machine/routerstationpro.conf | 3 +- .../linux-libc-headers-yocto_git.bb | 4 +- meta/recipes-kernel/linux/linux-tools.inc | 19 ++ .../recipes-kernel/linux/linux-yocto-stable_git.bb | 41 ++++ meta/recipes-kernel/linux/linux-yocto.inc | 23 ++ meta/recipes-kernel/linux/linux-yocto_git.bb | 219 ++------------------ 13 files changed, 336 insertions(+), 224 deletions(-) create mode 100644 meta/classes/kernel-yocto.bbclass create mode 100644 meta/recipes-kernel/linux/linux-tools.inc create mode 100644 meta/recipes-kernel/linux/linux-yocto-stable_git.bb create mode 100644 meta/recipes-kernel/linux/linux-yocto.inc
meta-emenlow/conf/machine/emenlow.conf +2 -1
@@ -16,7 +16,8 @@ MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost ext2 ext3 x86 \ KERNEL_IMAGETYPE = "bzImage" -PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-stable" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" PREFERRED_PROVIDER_libdrm = "libdrm-poulsbo" PREFERRED_PROVIDER_drm = "libdrm-poulsbo" PREFERRED_PROVIDER_virtual/libx11 = "libx11-trim"
meta/classes/kernel-yocto.bbclass new file +202 -0
202 lines not on this page · raw message
meta/conf/distro/include/poky-default-revisions.inc +24 -12
@@ -56,7 +56,7 @@ SRCREV_pn-gypsy ??= "147" SRCREV_pn-inputproto ??= "7203036522ba9d4b224d282d6afc2d0b947711ee" SRCREV_pn-inputproto-native ??= "7203036522ba9d4b224d282d6afc2d0b947711ee" SRCREV_pn-inputproto-nativesdk ??= "7203036522ba9d4b224d282d6afc2d0b947711ee" -SRCREV_pn-kern-tools-native ??= "9722d8decacd2b750f079b3fde7918810700f80e" +SRCREV_pn-kern-tools-native ??= "c85dcdd2dc50d71476a11c2960bf14c2b144b3c7" SRCREV_pn-libdrm ??= "3f3c5be6f908272199ccf53f108b1124bfe0a00e" SRCREV_pn-libfakekey ??= "2031" SRCREV_pn-libgdbus ??= "aeab6e3c0185b271ca343b439470491b99cc587f"
@@ -83,17 +83,29 @@ SRCREV_pn-linux-omap-zoomsync ??= "015cbaf1035cd9a61d33a27de2a22902555db3c5" SRCREV_pn-linux-omap2 ??= "d3b3ae0fe6c71641da19c8de466ec366d39847e3" SRCREV_pn-linux-omap3 ??= "de1121fdb899f762b9e717f44eaf3fae7c00cd3e" SRCREV_pn-linux-omap3-pm ??= "totallybroken" -SRCREV_machine_pn-linux-yocto_qemuarm ?= "4f4177b4bea5b8858acc1eeb788d80b7af0df962" -SRCREV_machine_pn-linux-yocto_qemumips ?= "81f3cd467b9d51fa1dfa2d5939337cc756ae8061" -SRCREV_machine_pn-linux-yocto_qemuppc ?= "9ac0daee43dd19d8bea828cf79450c9748ae0daa" -SRCREV_machine_pn-linux-yocto_qemux86 ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" -SRCREV_machine_pn-linux-yocto_qemux86-64 ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" -SRCREV_machine_pn-linux-yocto_emenlow ?= "aae69fdf104b0a9d7b3710f808aac6ab303490f7" -SRCREV_machine_pn-linux-yocto_atom-pc ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" -SRCREV_machine_pn-linux-yocto_routerstationpro ?= "2ec2edaf256dd8500ee3d4763fee6ca3ecd6da4b" -SRCREV_machine_pn-linux-yocto_mpc8315e-rdb ?= "986e6eb66c26007cee7916d5d12f4756e6b5436f" -SRCREV_machine_pn-linux-yocto_beagleboard ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" -SRCREV_meta_pn-linux-yocto ?= "d1cd5c80ee97e81e130be8c3de3965b770f320d6" +SRCREV_machine_pn-linux-yocto-stable_qemuarm ?= "4f4177b4bea5b8858acc1eeb788d80b7af0df962" +SRCREV_machine_pn-linux-yocto-stable_qemumips ?= "81f3cd467b9d51fa1dfa2d5939337cc756ae8061" +SRCREV_machine_pn-linux-yocto-stable_qemuppc ?= "9ac0daee43dd19d8bea828cf79450c9748ae0daa" +SRCREV_machine_pn-linux-yocto-stable_qemux86 ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" +SRCREV_machine_pn-linux-yocto-stable_qemux86-64 ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" +SRCREV_machine_pn-linux-yocto-stable_emenlow ?= "aae69fdf104b0a9d7b3710f808aac6ab303490f7" +SRCREV_machine_pn-linux-yocto-stable_atom-pc ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" +SRCREV_machine_pn-linux-yocto-stable_routerstationpro ?= "2ec2edaf256dd8500ee3d4763fee6ca3ecd6da4b" +SRCREV_machine_pn-linux-yocto-stable_mpc8315e-rdb ?= "986e6eb66c26007cee7916d5d12f4756e6b5436f" +SRCREV_machine_pn-linux-yocto-stable_beagleboard ?= "0431115c9d720fee5bb105f6a7411efb4f851d26" +SRCREV_meta_pn-linux-yocto-stable ?= "d1cd5c80ee97e81e130be8c3de3965b770f320d6" +# development SRCREVs +SRCREV_machine_pn-linux-yocto_qemuarm = "87e00a2d47ba80b4ad1f9170cb3f6cf81f21d739" +SRCREV_machine_pn-linux-yocto_qemumips = "7231e473dd981a28e3cea9f677ed60583e731550" +SRCREV_machine_pn-linux-yocto_qemuppc = "3ab3559637130b65d8889fa74286fdb57935726f" +SRCREV_machine_pn-linux-yocto_qemux86 = "87aacc373557f8849dde8618fbe1f7f8f2af6038" +SRCREV_machine_pn-linux-yocto_qemux86-64 = "87aacc373557f8849dde8618fbe1f7f8f2af6038" +SRCREV_machine_pn-linux-yocto_emenlow = "87aacc373557f8849dde8618fbe1f7f8f2af6038" +SRCREV_machine_pn-linux-yocto_atom-pc = "87aacc373557f8849dde8618fbe1f7f8f2af6038" +SRCREV_machine_pn-linux-yocto_routerstationpro = "773d3a1c8eba563ffcdbf61057ef6e39cee0c88b" +SRCREV_machine_pn-linux-yocto_mpc8315e-rdb = "5ff609967ffe87c49d534d7861a7e0b150517726" +SRCREV_machine_pn-linux-yocto_beagleboard = "87aacc373557f8849dde8618fbe1f7f8f2af6038" +SRCREV_meta_pn-linux-yocto ?= "ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9" SRCREV_pn-linux-libc-headers-yocto ??= "09a39c638dd65dc27c549c119abe1af2631b2ae0" SRCREV_pn-matchbox-config-gtk ??= "2081" SRCREV_pn-matchbox-desktop-sato ??= "76"
meta/conf/machine/atom-pc.conf +2 -1
@@ -13,7 +13,8 @@ MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost ext2 ext3 x86 wifi \ KERNEL_IMAGETYPE = "bzImage" -PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim" PREFERRED_PROVIDER_virtual/libgl ?= "mesa-dri" PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86-dri-lite"
meta/conf/machine/beagleboard.conf +2 -1
@@ -22,7 +22,8 @@ EXTRA_IMAGECMD_jffs2 = "-lnp " # Guesswork SERIAL_CONSOLE = "115200 ttyS2" -PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-stable" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" KERNEL_IMAGETYPE = "uImage"
meta/conf/machine/include/qemu.inc +1 -0
@@ -16,5 +16,6 @@ RDEPENDS_kernel-base = "" # Use a common kernel recipe for all QEMU machines PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
meta/conf/machine/mpc8315e-rdb.conf +2 -1
@@ -13,4 +13,5 @@ SERIAL_CONSOLE = "115200 ttyS0" MACHINE_FEATURES = "kernel26 keyboard pci ext2 ext3 serial" -PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-stable" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto"
meta/conf/machine/routerstationpro.conf +2 -1
@@ -12,7 +12,8 @@ MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost ext2 ext3 \ KERNEL_IMAGETYPE = "vmlinux" KERNEL_ALT_IMAGETYPE = "vmlinux.bin" -PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-stable" +#PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto" SERIAL_CONSOLE = "115200 ttyS0"
meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb +2 -2
@@ -4,7 +4,7 @@ INHIBIT_DEFAULT_DEPS = "1" DEPENDS += "unifdef-native" PROVIDES = "linux-libc-headers" PV = "2.6.34+git-${SRCPV}" -PR = "r0" +PR = "r1" SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;fullclone=1"
@@ -45,7 +45,7 @@ do_compile () { do_install() { set_arch - oe_runmake headers_install_all INSTALL_HDR_PATH=${D}${exec_prefix} ARCH=$ARCH + oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix} ARCH=$ARCH } BBCLASSEXTEND = "nativesdk"
meta/recipes-kernel/linux/linux-tools.inc new file +19 -0
@@ -0,0 +1,19 @@ +# included by kernel recipes if they want to build/provide +# perf functionality from their tree. + +do_compile_perf() { + oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} +} + +do_install_perf() { + oe_runmake -C ${S}/tools/perf CC="${KERNEL_CC}" LD="${KERNEL_LD}" prefix=${prefix} DESTDIR=${D} install +} + + +# perf tasks +addtask compile_perf after do_compile before do_install +addtask install_perf after do_install before do_package do_deploy + +do_compile_perf[depends] = "virtual/libc:do_populate_sysroot" +do_compile_perf[depends] =+ "elfutils:do_populate_sysroot" +RDEPENDS_perf += "python perl elfutils"
meta/recipes-kernel/linux/linux-yocto-stable_git.bb new file +41 -0
41 lines not on this page · raw message
meta/recipes-kernel/linux/linux-yocto.inc new file +23 -0
@@ -0,0 +1,23 @@ +DESCRIPTION = "Yocto Kernel" +SECTION = "kernel" +LICENSE = "GPL" + +# A KMACHINE is the mapping of a yocto $MACHINE to what is built +# by the kernel. This is typically the branch that should be built, +# and it can be specific to the machine or shared +KMACHINE = "UNDEFINED" + +COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64|atom-pc|routerstationpro)" + +# Set this to 'preempt_rt' in the local.conf if you want a real time kernel +LINUX_KERNEL_TYPE ?= standard + +do_patch[depends] = "kern-tools-native:do_populate_sysroot" + +addtask kernel_configme before do_configure after do_patch +addtask kernel_configcheck after do_configure before do_compile + +# Pick up shared functions +inherit kernel-yocto + +B = "${WORKDIR}/linux-${KMACHINE}-${LINUX_KERNEL_TYPE}-build"
meta/recipes-kernel/linux/linux-yocto_git.bb +14 -205
234 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 2/3 linux-libc-headers-yocto: use common linux-yocto routines
In reply to Bruce AshfieldModify linux-libc-headers-yocto to use the common linux-yocto routines, so headers exported to userspace will track the branches in the yocto kernel git repository.
This commit also switches supported boards to prefer the yocto libc headers.
--- .../linux-libc-headers-yocto_git.bb | 21 ++++++++----------- 1 files changed, 9 insertions(+), 12 deletions(-)
meta/recipes-kernel/linux-libc-headers/linux-libc-headers-yocto_git.bb +9 -12
@@ -1,4 +1,7 @@ require linux-libc-headers.inc +include recipes-kernel/linux/linux-yocto.inc + +B = "${S}" INHIBIT_DEFAULT_DEPS = "1" DEPENDS += "unifdef-native"
@@ -8,7 +11,9 @@ PR = "r1" SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;fullclone=1" -S = "${WORKDIR}/linux" +SRCREV_FORMAT = "meta_machine" +SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \ + git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta" set_arch() { case ${TARGET_ARCH} in
@@ -26,19 +31,11 @@ do_configure() { oe_runmake allnoconfig ARCH=$ARCH } -do_kernel_checkout() { - if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then - rm -rf ${S} - mkdir ${S} - mv ${WORKDIR}/.git ${S} - mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads - rmdir ${S}/.git/refs/remotes/origin - fi - cd ${S} - git checkout -f standard +do_kernel_configme() { } -addtask kernel_checkout before do_patch after do_unpack +do_patch () { +} do_compile () { }
Signature · 1 line
1.7.0.4
PATCH 3/3 qemu: update arm timer handling
In reply to Bruce Ashfieldcommit e388771458b4ff3ad81ab70e390b24d069647da4 in the upstream kernel factored/cleaned the SP804 timer code. This commit exposed issues in the qemu timer emulation that was dependent on the old behaviour. As a result, no kernel past 2.6.34 would boot on qemu-system-arm.
The quick fix is to backport two patches from the latest qemu repositories that fix the timer handling under emulation. Long term, these will be dropped when qemu is upreved.
--- .../qemu-0.12.4/arm_timer-fix-oneshot-mode.patch | 32 ++++++++++++++++ .../arm_timer-reload-timer-when-enabled.patch | 40 ++++++++++++++++++++ meta/recipes-devtools/qemu/qemu_0.12.4.bb | 4 +- 3 files changed, 75 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-fix-oneshot-mode.patch create mode 100644 meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-reload-timer-when-enabled.patch
meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-fix-oneshot-mode.patch new file +32 -0
@@ -0,0 +1,32 @@ +From a9cf98d939c4f6539fad7e7d812ea16d96ba3dc9 Mon Sep 17 00:00:00 2001 +From: Rabin Vincent <[email protected]> +Date: Sun, 2 May 2010 15:20:52 +0530 +Subject: [PATCH] arm_timer: fix oneshot mode + +commit id: a9cf98d939c4f6539fad7e7d812ea16d96ba3dc9 in git://git.sv.gnu.org/qemu.git + +In oneshot mode, the delta needs to come from the TimerLoad register, +not the maximum limit. + +Signed-off-by: Rabin Vincent <[email protected]> +Signed-off-by: Aurelien Jarno <[email protected]> +--- + hw/arm_timer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/hw/arm_timer.c b/hw/arm_timer.c +index 5b6947a..9073ffc 100644 +--- a/hw/arm_timer.c ++++ b/hw/arm_timer.c +@@ -71,7 +71,7 @@ static void arm_timer_recalibrate(arm_timer_state *s, int reload) + { + uint32_t limit; + +- if ((s->control & TIMER_CTRL_PERIODIC) == 0) { ++ if ((s->control & (TIMER_CTRL_PERIODIC | TIMER_CTRL_ONESHOT)) == 0) { + /* Free running. */ + if (s->control & TIMER_CTRL_32BIT) + limit = 0xffffffff; +-- +1.6.5.2 +
meta/recipes-devtools/qemu/qemu-0.12.4/arm_timer-reload-timer-when-enabled.patch new file +40 -0
@@ -0,0 +1,40 @@ +From d6759902cb467c002086853d2eb38fb969c29f7f Mon Sep 17 00:00:00 2001 +From: Rabin Vincent <[email protected]> +Date: Sun, 2 May 2010 15:20:51 +0530 +Subject: [PATCH] arm_timer: reload timer when enabled + +commit id: d6759902cb467c002086853d2eb38fb969c29f7f in git://git.sv.gnu.org/qemu.git + +Reload the timer when TimerControl is written, if the timer is to be +enabled. Otherwise, if an earlier write to TimerLoad was done while +periodic mode was not set, s->delta may incorrectly still have the value +of the maximum limit instead of the value written to TimerLoad. + +This problem is evident on versatileap on current linux-next, which +enables TIMER_CTRL_32BIT before writing to TimerLoad and then enabling +periodic mode and starting the timer. This causes the first periodic +tick to be scheduled to occur after 0xffffffff periods, leading to a +perceived hang while the kernel waits for the first timer tick. + +Signed-off-by: Rabin Vincent <[email protected]> +Signed-off-by: Aurelien Jarno <[email protected]> +--- + hw/arm_timer.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/hw/arm_timer.c b/hw/arm_timer.c +index 9fef191..5b6947a 100644 +--- a/hw/arm_timer.c ++++ b/hw/arm_timer.c +@@ -113,7 +113,7 @@ static void arm_timer_write(void *opaque, target_phys_addr_t offset, + case 1: freq >>= 4; break; + case 2: freq >>= 8; break; + } +- arm_timer_recalibrate(s, 0); ++ arm_timer_recalibrate(s, s->control & TIMER_CTRL_ENABLE); + ptimer_set_freq(s->timer, freq); + if (s->control & TIMER_CTRL_ENABLE) { + /* Restart the timer if still enabled. */ +-- +1.6.5.2 +
meta/recipes-devtools/qemu/qemu_0.12.4.bb +3 -1
@@ -25,7 +25,9 @@ SRC_URI = "\ file://cursor-shadow-fix.patch \ file://vmware-vga-fifo-rewind.patch \ file://fix-configure-checks.patch \ - file://powerpc_rom.bin" + file://powerpc_rom.bin \ + file://arm_timer-fix-oneshot-mode.patch \ + file://arm_timer-reload-timer-when-enabled.patch" SRC_URI[md5sum] = "93e6b134dff89b2799f57b7d9e0e0fc5" SRC_URI[sha256sum] = "1a29a5b5151162d1de035c4926d1a1dbffee4a145ef61ee865d6b82aaea0602e"
Signature · 1 line
1.7.0.4