[U-Boot] [PATCH 2/6] i.mx: Add the initial support for freescale i.MX6Q processor

Stefano Babic sbabic at denx.de
Tue Nov 15 12:08:21 CET 2011


On 11/15/2011 11:10 AM, Jason Hui wrote:
>>> yes, we already had drivers/gpio/mxc_gpio.c driver. In this driver, we will
>>> use this structure. And it's the same as i.mx5 before.
>>
>> So why do you need to expose the structure, isn't it internal to the driver?
> Yes, it's internal to the gpio driver, but, all the soc does not have
> the same gpio_regs layout,
> so we put it here in order to have multiple #ifdef.
> Stefano, any comments for this?

We are using now the general GPIO framework - changes were done for all
iMX SOCs, and it is used in most other SOCs, too. So the general API is
exposed in include/asm/gpio.h.

We can have different implementation for each specific SOC. We want to
maintain only one driver (mxc_gpio.c), and the differences in layout are
done in arch/gpio.h (at the end, the structure we are talking about). As
you can see, there is a lot of specific implementation in asm/arch-*.
The generic API (include/asm/gpio.h) includes an arch specific file
asm/arch/gpio, and this file must be provided.

This allows us (theoretically) to adapt the driver to the specific
layout of the SOC. This helps if the layout of MX3x is differnt form the
layout of MX5x, MX6x,...

I admit that the layout for the interesting fields (data, direction) is
the same (see asm/arch-mx25/gpio.h, asm/arch-mx35/gpio.h and
asm/arch-mx5/gpio.h). There is the definition of other registers, but
they are not used. We have to provide in any case an arch specific
gpio.h, and this can contains the differences in layout, if any.

Another possibility can be to put the registers in a common place for
all IMX SOCs, and the arch specific gpio.h, required by the generic
gpio.h, will only include it. But if we go on on this solution (only if
we have *really* the same layout for all SOCs), this should be done for
all IMX in a shot, not only for one of them - I do not like to have
inconsistencies in the interface between IMX SOCs.

Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list