From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory!
Date: Wed, 30 Jul 2008 08:52:15 +0200 [thread overview]
Message-ID: <20080730065215.GA30747@game.jcrosoft.org> (raw)
In-Reply-To: <008701c8f1ec$e023d640$30065e0a@SHZ.ST.COM>
On 10:35 Wed 30 Jul , Ryan CHEN wrote:
> commit 7f818bb236de596c5bbcf21919625db9912b2c43
> Parent: 699f05125509249072a0b865c8d35520d97cd501
> Author: Ryan Chen <ryan.chen@st.com>
> Date: Wed Jul 30 06:26:36 2008 -0400
>
> Signed-off-by: Ryan Chen <ryan.chen@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@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@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.
next prev parent reply other threads:[~2008-07-30 6:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 2:35 [U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory! Ryan CHEN
2008-07-30 6:52 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-07-30 7:03 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080730065215.GA30747@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox