
15 Sep
2007
15 Sep
'07
4:08 a.m.
Resend it I clicked the reply button instead of reply-all
On 9/14/07, Wolfgang Denk wd@denx.de wrote:
In message 20070914005131.GA14660@party you wrote:
Apollon BSP support
The Apollon based on OMAP2420 is designed for OneNAND development. It's similar with OMAP2420 H4 except some peripherals.
... ...
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_PUEN;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VP;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VM;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_RCV;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_TXEN;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_SE0;
*MuxConfigReg &= (uint8) (~0x1F);
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_DAT;
*MuxConfigReg &= (uint8) (~0x1F);
...
You use this sequence extensively. In the current form, it's extremly lengthy, difficult to read and difficult to maintain.
Please define an (inline?) fintion which performs the actions and allows you to change (for example)
/* V19 */
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_RCV;
*MuxConfigReg = 1;
/* W20 */
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_TXEN;
*MuxConfigReg = 1;
/* N14 */
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO69;
*MuxConfigReg = 3;
/* P15 */
MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO70;
*MuxConfigReg = 3;
into
write_config_reg (CONTROL_PADCONF_USB1_RCV, 1); /* V19 */ write_config_reg (CONTROL_PADCONF_USB1_TXEN, 1); /* W20 */ write_config_reg (CONTROL_PADCONF_GPIO69, 3); /* N14 */ write_config_reg (CONTROL_PADCONF_GPIO70, 3); /* P15 */
This is IMO *much* easier to read and understand.
Oh, it's better. Actually I borrowed it from omap2420 and modified for apollon board. I will modify it as you suggested
Thank you, Kyungmin Park