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

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

Dear Ajay Bhargav,
In message 107544326.47582.1310126592414.JavaMail.root@ahm.einfochips.com you wrote:
I did get your point sir, but...
...
asm/arch-kirkwood/gpio.h)>
Bad examples are no excuse for adding more bad code.
Some things only get noticed when they already exist. But once noticed, we should not repeat the same mistakes.
Best regards,
Wolfgang Denk
participants (2)
-
Ajay Bhargav
-
Wolfgang Denk