[uClinux-dev] [RFC] m68knommu: add support for Coldfire 5251/5253.

Steven King sfking at fdwdc.com
Mon May 14 04:26:49 EDT 2012


On Sunday 13 May 2012 11:36:23 pm Greg Ungerer wrote:

> 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?

Oh definitely.  I just found it easier at this point to have them separate, 
but I anticipated trying to get rid of most of the duplication later once it 
started taking its final form.

> 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.

It should be pretty easy.  The '49 appears to be mostly a subset of the '5x, 
with the '49 having a few registers in mbar that the '5x doesn't and a few 
other minor differences (sram, number of chip selects, and qspi chip selects, 
etc),  

> > +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?

Yes, since you can trigger on either or both edges, and the only place to 
control which is with the gpiointenable reg. 

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

I think so, the only real difference I can see between the '49 and the '5x 
gpio interrupts is the number (the '49 has 8 while the '5x has 7).  Thus I 
thought this code was a prime candidate for merging with the '49.

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

Cool.  I expect to have some more patches soon; the 525x has an rtc which 
looks simple to support and the 5253demo board has a wm8731 connected to the 
i2c, and as the wm8731 is supported by alsa, it should be possible to have 
coldfire board with alsa SoC support....






More information about the uClinux-dev mailing list