[U-Boot-Users] Patch generalizing IDE Reset function for MPC5200

Wolfgang Denk wd at denx.de
Mon Mar 1 13:00:09 CET 2004


In message <00ee01c3ff80$3b641f60$644ba8c0 at alb.sub.de> you wrote:
> 
> The following patch generalises the use of PSC1.4 for IDE Reset. The idea
> behind is that most probably many 5200 designs will be similiar to IceCube,

Such assumptions are know to fail on the very next board that will be
added.

> Instead of continuosly adding more and more boards into the #if defined ()
> chain, one define
> CONFIG_IDE_RESET_USE_PSC1_4 can be added to the board's configuration file.

Urggh. What an ugly name.

> If someone else uses another I/O port, that can be easyly added in a
> similiar way.

Yes, and we end up "adding more and more  boards  into  the  "#define
CONFIG_IDE_RESET_USE_this"  and  "#define  CONFIG_IDE_RESET_USE_that"
chain.

Sorry, this code is ugly and I reject it.



> -#if defined (CONFIG_ICECUBE) && defined (CONFIG_IDE_RESET)
> +#if defined (CONFIG_IDE_RESET_USE_PSC1_4)
>  	/* Configure PSC1_4 as GPIO output for ATA reset */
>  	*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
>  	*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
>  	*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
> -#endif /* defined (CONFIG_ICECUBE) && defined (CONFIG_IDE_RESET) */
> +#endif /* defined (CONFIG_IDE_RESET_USE_PSC1_4) */

How about changing this into something like??

include/configs/???.h:
...
#define	CONFIG_IDE_RESET_PIN	GPIO_PSC1_4

...
#ifdef CONFIG_IDE_RESET_PIN
	/* Configure IDE Reset pin as GPIO output for ATA reset */
	*(vu_long *) MPC5XXX_WU_GPIO_DATA |= CONFIG_IDE_RESET_PIN;
	...
#endif
...

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
It's hard to think of you as the end result of millions of  years  of
evolution.




More information about the U-Boot mailing list