svn commit: r210246 - in head/sys: arm/mv conf dev/fdt

Rafal Jaworowski raj at FreeBSD.org
Mon Jul 19 18:41:52 UTC 2010


Author: raj
Date: Mon Jul 19 18:41:50 2010
New Revision: 210246
URL: http://svn.freebsd.org/changeset/base/210246

Log:
  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).

Deleted:
  head/sys/dev/fdt/fdt_arm.c
Modified:
  head/sys/arm/mv/common.c
  head/sys/conf/files.arm

Modified: head/sys/arm/mv/common.c
==============================================================================
--- head/sys/arm/mv/common.c	Mon Jul 19 18:20:44 2010	(r210245)
+++ head/sys/arm/mv/common.c	Mon Jul 19 18:41:50 2010	(r210246)
@@ -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
+};

Modified: head/sys/conf/files.arm
==============================================================================
--- head/sys/conf/files.arm	Mon Jul 19 18:20:44 2010	(r210245)
+++ head/sys/conf/files.arm	Mon Jul 19 18:41:50 2010	(r210246)
@@ -47,7 +47,6 @@ arm/arm/vm_machdep.c		standard
 arm/fpe-arm/armfpe_glue.S	optional	armfpe
 arm/fpe-arm/armfpe_init.c	optional	armfpe
 arm/fpe-arm/armfpe.S		optional	armfpe
-dev/fdt/fdt_arm.c		optional	fdt
 dev/hwpmc/hwpmc_arm.c		optional	hwpmc
 dev/ofw/openfirm.c		optional	fdt
 dev/ofw/openfirmio.c		optional	fdt


More information about the svn-src-all mailing list