[U-Boot] [PATCH 1/4] Armada100: Ethernet support for Marvell gplugD

Ajay Bhargav
2011-07-08T12:03:12Z

Dear Wolfdang,

I did get your point sir, but...

> To me this looks different.

> - Do not use a "base address + offset" notation (with a declartion of
> register offsets in your header files), but use C structs instead to
> describe the regioster layout, and then use proper I/O accessor
> functions on them.

asm/arch-kirkwood/gpio.h)>
#define GPIO_OFF(pin) (((pin) >> 5) ? 0x0040 : 0x0000)
#define GPIO_OUT(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x00)
#define GPIO_IO_CONF(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x04)

#define GPIO_REG(x) (GPIO_REGS_VIRT + (x))
#define GPLR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x00)
#define GPDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x0c)

> - Do not implement your own GPIO framework, but instead use existing
> code.

I did not tried anything on my own. I just tried similar things which were done
by others already. I hope I am able to highlight what i am trying to say.

Regards,
Ajay Bhargav