[U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory!

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Jul 30 08:52:15 CEST 2008


On 10:35 Wed 30 Jul     , Ryan CHEN wrote:
> commit 7f818bb236de596c5bbcf21919625db9912b2c43
> Parent: 699f05125509249072a0b865c8d35520d97cd501
> Author: Ryan Chen <ryan.chen at st.com>
> Date:   Wed Jul 30 06:26:36 2008 -0400
> 
>     Signed-off-by: Ryan Chen <ryan.chen at st.com>
>     
>     	new file:   board/st/stls/flash.c
Could you integrate it in the mtd support?
>     	new file:   board/st/stls/ide.c
>     	new file:   board/st/stls/pci.c
> 
> diff --git a/board/st/stls/ide.c b/board/st/stls/ide.c
> new file mode 100755
> index 0000000..0954b3f
> --- /dev/null
> +++ b/board/st/stls/ide.c
> @@ -0,0 +1,110 @@
> +/* 
> + * Prototypes, etc. for the STMicroelectronics STLS
> + *
> + * 2008 (c) STMicroelectronics, Inc.
> + * Author: Ryan Chen <Ryan.Chen at st.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +#include <common.h>
> +#if defined (CONFIG_CMD_IDE) && defined(CONFIG_MULTI_IDE_CONTROLLER)
> +#if defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)
> +#include <vt82c686.h>
> +#endif/*defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)*/
> +#ifdef CFG_SATA_VIA
> +#include <sata_via.h>
> +#endif/* CFG_SATA_VIA */
> +#if defined(CONFIG_SATA_SIL)
> +extern int ide_sata_sil_preinit (void);
> +extern void ide_sata_sil_set_reset (int flag);
> +#endif/* CONFIG_SATA_SIL */
> +#ifdef CFG_IDE_SIL680
> +extern int ide_sil680_preinit (void);
> +extern void ide_sil680_set_reset (int flag);
please use an include instead of extern
> +#endif/* CFG_IDE_SIL680 */
> +
> +#ifdef DEBUG_IDE
> +#define PRINTF(fmt,args...)	printf (fmt ,##args)
> +#else
> +#define PRINTF(fmt,args...)
> +#endif
> +
> +extern u16 real_ide_max_buses;
> +extern u16 real_ide_max_devices;
> +extern ulong ide_bus_offset[CFG_IDE_MAXBUS];
> 

please spit it into 2 files one for the ide support and one for the sata
support.

You have 2 comands CONFIG_CMD_IDE and CONFIG_CMD_SATA in u-boot for each
support.

+
> +int ide_preinit (void)
> +{
> +	int l;
please be carefull whit the whitespace
> +	int oldstatus = -1;		
                           ^^^^^^^^^^^^^
> +	int status = -1;
> +	
   ^^^^^
please remove the whitespace
> +	for (l = 0; l < CFG_IDE_MAXBUS; l++) {
> +		ide_bus_offset[l] = -1;
> +	}
> +	
   ^^^^^
please remove the whitespace
> +	/* clean them to calculate real values */
> +	real_ide_max_buses = 0;
> +	real_ide_max_devices = 0;
> +
> +#if defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)
> +	status = ide_via_preinit();
> +	if(!status) {
> +		PRINTF("IDE: VIA IDE Controller Init Done!\n");
> +		oldstatus = 0;
> +	}
> +#endif/*defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)*/
> +#if defined(CONFIG_SATA_SIL)
> +	status = ide_sata_sil_preinit();
> +	if(!status) {
> +		PRINTF("IDE: SIL SATA Controller Init Done!\n");
> +		oldstatus = 0;
> +	}
> +#endif/*CONFIG_SATA_SIL*/
> +#ifdef CFG_IDE_SIL680
> +	status = ide_sil680_preinit();
> +	if(!status) {
> +		PRINTF("IDE: SIL680 Controller Init Done!\n");
> +		oldstatus = 0;
> +	}	
         ^^^^^^^
please remove the whitespace
> +#endif/* CFG_IDE_SIL680 */
> +#ifdef CFG_SATA_VIA
> +	status = sata_via_preinit();
> +	if(!status) {
> +		PRINTF("IDE: VIA SATA Controller Init Done!\n");
> +		oldstatus = 0;
> +	}
> +#endif/* CFG_SATA_VIA */
> +	return oldstatus;
> +}
> +
> +void ide_set_reset (int flag) 
please remove the whitespace
> +{
> +#if defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)
> +	ide_via_set_reset (flag);
> +#endif/*defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)*/
> +#if defined(CONFIG_SATA_SIL)
> +	ide_sata_sil_set_reset(flag);
> +#endif/*CONFIG_SATA_SIL*/
> +#ifdef CFG_IDE_SIL680
> +	ide_sil680_set_reset(flag);
> +#endif/* CFG_IDE_SIL680 */
> +#ifdef CFG_SATA_VIA
> +	sata_via_set_reset(flag);
> +#endif/* CFG_SATA_VIA */
> +	return;
> +}
> +#endif/*CONFIG_CMD_IDE*/
> diff --git a/board/st/stls/pci.c b/board/st/stls/pci.c
> new file mode 100755
> index 0000000..072887d
> --- /dev/null
> +++ b/board/st/stls/pci.c
> @@ -0,0 +1,104 @@
> +/* 
> + * Prototypes, etc. for the STMicroelectronics STLS
> + *
> + * 2008 (c) STMicroelectronics, Inc.
> + * Author: Ryan Chen <Ryan.Chen at st.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +#include <common.h>
> +#ifdef CONFIG_PCI
please move this to the Makefile
> +#include <pci.h>
> +#ifdef CONFIG_STLS
> +#include <asm/stls/pci.h>
> +#endif
> +#if 0
if no need please remove
> +#if defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)
> +#include <vt82c686.h>
> +#endif
> +
> +void pci_legacy_init(void)
> +{
> +#if defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B)
> +	if(init_sb_isa())
> +		printf("Init VIA ISA Bridge init fail!\n");
> +	if(init_sb_serial()) 
> +		printf("Init VIA Serial Ports Error!\n");
> +	if(init_sb_keypad())
> +		printf("Init VIA Keypad Ports Error!\n");
> +	if(init_sb_irq())
> +		printf("VIA IRQ init fail!\n");
> +	if(init_sb_audio())
> +		printf("Init VIA AC97 Error!\n");
> +	if(init_sb_misc())
> +		printf("Init VIA Misc Error!\n");
> +#endif/* defined(CONFIG_VT82C686A) || defined(CONFIG_VT82C686B) */
> +}
Best Regards,
J.




More information about the U-Boot mailing list