From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ajay Bhargav Date: Fri, 8 Jul 2011 17:33:12 +0530 (IST) Subject: [U-Boot] [PATCH 1/4] Armada100: Ethernet support for Marvell gplugD In-Reply-To: <751999513.47571.1310126396909.JavaMail.root@ahm.einfochips.com> Message-ID: <107544326.47582.1310126592414.JavaMail.root@ahm.einfochips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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