summaryrefslogtreecommitdiffstats
path: root/sys/arm/mv/common.c
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2010-07-19 18:41:50 +0000
committerraj <raj@FreeBSD.org>2010-07-19 18:41:50 +0000
commit1dddc6de1e8ed3c2ac6a7521a460ef6e31b30ea8 (patch)
treebf96e0b0ce2702debfea3264a4080d24e7eb829c /sys/arm/mv/common.c
parent03322b9583f994bbf1a5d4b51549fc6b0c19eb25 (diff)
downloadFreeBSD-src-1dddc6de1e8ed3c2ac6a7521a460ef6e31b30ea8.zip
FreeBSD-src-1dddc6de1e8ed3c2ac6a7521a460ef6e31b30ea8.tar.gz
Move MRVL FDT fixups and PIC decode routine to a platform specific area.
This allows for better encapsulation (and eliminates generic fdt_arm.c, at least for now).
Diffstat (limited to 'sys/arm/mv/common.c')
-rw-r--r--sys/arm/mv/common.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/arm/mv/common.c b/sys/arm/mv/common.c
index 700dbb2..16bd325 100644
--- a/sys/arm/mv/common.c
+++ b/sys/arm/mv/common.c
@@ -1834,3 +1834,45 @@ fdt_win_setup(void)
return (0);
}
+
+static void
+fdt_fixup_busfreq(phandle_t root)
+{
+ phandle_t sb;
+ pcell_t freq;
+
+ /*
+ * This fixup sets the simple-bus bus-frequency property.
+ */
+
+ if ((sb = fdt_find_compatible(root, "simple-bus", 1)) == 0)
+ return;
+
+ freq = cpu_to_fdt32(get_tclk());
+ OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq));
+}
+
+struct fdt_fixup_entry fdt_fixup_table[] = {
+ { "mrvl,DB-88F6281", &fdt_fixup_busfreq },
+ { NULL, NULL }
+};
+
+static int
+fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
+ int *pol)
+{
+
+ if (!fdt_is_compatible(node, "mrvl,pic"))
+ return (ENXIO);
+
+ *interrupt = fdt32_to_cpu(intr[0]);
+ *trig = INTR_TRIGGER_CONFORM;
+ *pol = INTR_POLARITY_CONFORM;
+
+ return (0);
+}
+
+fdt_pic_decode_t fdt_pic_table[] = {
+ &fdt_pic_decode_ic,
+ NULL
+};
OpenPOWER on IntegriCloud