lkml.org 
[lkml]   [2010]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 06/11] x86/dtb: add support hpet
Date
Set hpet_address based on information provied form DTB

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
CC: x86@kernel.org
Cc: devicetree-discuss@lists.ozlabs.org
Tested-by: Dirk Brandewie <dirk.brandewie@gmail.com>
---
arch/x86/kernel/prom.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/prom.c b/arch/x86/kernel/prom.c
index 9551f2f..f61c541 100644
--- a/arch/x86/kernel/prom.c
+++ b/arch/x86/kernel/prom.c
@@ -9,6 +9,7 @@
#include <linux/of_platform.h>
#include <linux/slab.h>

+#include <asm/hpet.h>
#include <asm/irq_controller.h>
#include <asm/io_apic.h>

@@ -99,6 +100,27 @@ void __init add_dtb(u64 data)
offsetof(struct setup_data, data));
}

+static int __init early_scan_hpet(unsigned long node, const char *uname,
+ int depth, void *data)
+{
+ unsigned long l;
+ int ret;
+ __be32 *cell;
+
+ if (depth != 2)
+ return 0;
+
+ ret = of_flat_dt_is_compatible(node, "intel,hpet");
+ if (!ret)
+ return 0;
+
+ cell = of_get_flat_dt_prop(node, "phys_reg", &l);
+ if (!cell)
+ return 0;
+ hpet_address = of_read_ulong(cell, l / 4);
+ return 1;
+}
+
static void __init of_lapic_setup(void)
{
#ifdef CONFIG_X86_LOCAL_APIC
@@ -195,6 +217,7 @@ void __init x86_early_of_parse(void)

/* root level address cells */
of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ of_scan_flat_dt(early_scan_hpet, NULL);
of_apic_setup();

early_iounmap(initial_boot_params, size);
--
1.7.3.2


\
 
 \ /
  Last update: 2010-11-25 18:47    [W:0.142 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site