Hi Steven,

On 14/05/12 10:44, Steven King wrote:
The 5251/5253 is quite similar to the 5249, adding basic support for it is
fairly trivial.  This is a work in progress, not much support for anything
beyond the basic Coldfire core is implemented yet, but more patches to
come ;)

Nice :-)


This patch is against the v3.4-rc6 for_next branch of the m68knommu.git

Some parts do look very similar to the 5249. The m525xsim.h for example,
probably 90+% is the same. Can we generalize the 5249 support and rework
it to support the 5251/5253 parts as well?

I am thinking something like changing CONFIG_M5249 to use CONFIG_M525x
instead. I know it isn't a perfect match, but Freescale have done this
to us before, where part numbering isn't completely consistent (527x and
5272 for one). Only a coueple of #ifdefs in m5249sim.h, and maybe move
out the 5249c3 startup code to a better place.


[snip]
diff --git a/arch/m68k/platform/coldfire/intc-525x.c 
b/arch/m68k/platform/coldfire/intc-525x.c
new file mode 100644
index 0000000..b23204d
--- /dev/null
+++ b/arch/m68k/platform/coldfire/intc-525x.c
@@ -0,0 +1,91 @@
+/*
+ * intc2.c  -- support for the 2nd INTC controller of the 525x
+ *
+ * (C) Copyright 2012, Steven King<sfk...@fdwdc.com>
+ * (C) Copyright 2009, Greg Ungerer<g...@snapgear.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#include<linux/types.h>
+#include<linux/init.h>
+#include<linux/kernel.h>
+#include<linux/interrupt.h>
+#include<linux/irq.h>
+#include<linux/io.h>
+#include<asm/coldfire.h>
+#include<asm/mcfsim.h>
+
+static void intc2_irq_gpio_mask(struct irq_data *d)
+{
+       u32 imr = readl(MCFSIM2_GPIOINTENABLE);
+       u32 type = irqd_get_trigger_type(d);
+       int irq = d->irq - MCF_IRQ_GPIO0;
+
+       if (type&  IRQ_TYPE_EDGE_RISING)
+               imr&= ~(0x001<<  irq);
+       if (type&  IRQ_TYPE_EDGE_FALLING)
+               imr&= ~(0x100<<  irq);

I haven't looked up the datasheet (don't have one handy :-) but do you
really need to handle these here in the mask code?

(And do you know if the 5249 needs/wants to do the same things?)

Forgetting generalizing for a moment, the changes look pretty
clean to me though.

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to