Armada100: Ethernet support for Marvell gplugD
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/4 Armada100: Ethernet support for Marvell gplugD
Dear Wolfdang,
I did get your point sir, but...
Quoted 6 lines
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)
Quoted 2 lines
- 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
PATCH 1/4 Armada100: Ethernet support for Marvell gplugD
Dear Ajay Bhargav,
Quoted 2 lines · In message <[email protected]>…
I did get your point sir, but...
...
Quoted 1 line
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
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Lots of folks confuse bad management with destiny. -- Frank Hubbard