[U-Boot] [PATCH] M28: Added guarding for reserved bits in GPIO driver

Marek Vasut marek.vasut at gmail.com
Tue Nov 22 23:36:51 CET 2011


> > Careful here !!
> > 
> > The driver _should_ work for MX233 too! What I'd like to see is you
> > introducing a function like:
> > 
> > int mxs_gpio_is_valid(gpio)
> > {
> > char mxs_banks[PINCTRL_BANKS] = PINCTRL_BANK_COUNTS;
> > 
> > if (PAD_PIN(gpio) > mxs_bank[PAD_BANK(gpio)])
> > 
> > 	return -EINVAL;
> > 
> > return 0;
> > }
> > 
> > And define PINCTRL_BANK_COUNTS in the section of mxs_gpio.c where all the
> > remaining mx28 and mx233 specific defines are hoarded (near the top of
> > the file).
> 
> Does mx233 use arch/arm/include/asm/arch-mx28/iomux.h? In that case we
> should consider renaming it to arch/arm/include/asm/arch-mxs, for all
> Sigmatel base FreeScale SoCs.

It doesn't, because it's not yet supported.
> 
> I do like the idea of a function validating pins. If I'm going to introduce
> changes that big, I may also introduce functionality to set pin functions
> run-time, as that is very useful during board bring-up.

Please introduce the validation function first, the runtime stuff can be done 
later.

M


More information about the U-Boot mailing list