Re: [U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory!
On 10:35 Wed 30 Jul , Ryan CHEN wrote: commit 7f818bb236de596c5bbcf21919625db9912b2c43 Parent: 699f05125509249072a0b865c8d35520d97cd501 Author: Ryan Chen [EMAIL PROTECTED] Date: Wed Jul 30 06:26:36 2008 -0400 Signed-off-by: Ryan Chen [EMAIL PROTECTED] 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 000..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 [EMAIL PROTECTED] + * + * 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 000..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 [EMAIL PROTECTED] + * + * This program is free software; you can redistribute it and/or + * modify it under the terms
Re: [U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory!
In message [EMAIL PROTECTED] you wrote: commit 7f818bb236de596c5bbcf21919625db9912b2c43 Parent: 699f05125509249072a0b865c8d35520d97cd501 Author: Ryan Chen [EMAIL PROTECTED] Date: Wed Jul 30 06:26:36 2008 -0400 Signed-off-by: Ryan Chen [EMAIL PROTECTED] new file: board/st/stls/flash.c new file: board/st/stls/ide.c new file: board/st/stls/pci.c Please use git-format-patch to prepare the patch. See also hints aboyut missing patch sequence / threading in previous mail. diff --git a/board/st/stls/flash.c b/board/st/stls/flash.c new file mode 100755 index 000..1afee80 --- /dev/null +++ b/board/st/stls/flash.c I reject this patch. Please use the CFI driver instead of adding custom code. diff --git a/board/st/stls/ide.c b/board/st/stls/ide.c new file mode 100755 index 000..0954b3f --- /dev/null +++ b/board/st/stls/ide.c @@ -0,0 +1,110 @@ +/* + * Prototypes, etc. for the STMicroelectronics STLS This comment seems to be wrong ? + * 2008 (c) STMicroelectronics, Inc. + * Author: Ryan Chen [EMAIL PROTECTED] + * + * 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 */ There are no such #defines as CONFIG_VT82C686A or CONFIG_VT82C686B or CFG_SATA_VIA in U-Boot. CONFIG_VT* versus CFG_SATA_* is inconsistent. There are no such header files as vt82c686.h or sata_via.h in U-Boot. This seems to need some major cleanup ?? +#ifdef DEBUG_IDE +#define PRINTF(fmt,args...) printf (fmt ,##args) +#else +#define PRINTF(fmt,args...) +#endif Please use debug() for debug messages. diff --git a/board/st/stls/pci.c b/board/st/stls/pci.c new file mode 100755 index 000..072887d --- /dev/null +++ b/board/st/stls/pci.c ... +#include common.h +#ifdef CONFIG_PCI +#include pci.h +#ifdef CONFIG_STLS +#include asm/stls/pci.h +#endif +#if 0 Please do not add dead code. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED] Faith: not *wanting* to know what is true.- Friedrich Nietzsche - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH for STLS]: Add flash.c, ide.c and pci.c in board/st/stls/ directory!
commit 7f818bb236de596c5bbcf21919625db9912b2c43 Parent: 699f05125509249072a0b865c8d35520d97cd501 Author: Ryan Chen [EMAIL PROTECTED] Date: Wed Jul 30 06:26:36 2008 -0400 Signed-off-by: Ryan Chen [EMAIL PROTECTED] new file: board/st/stls/flash.c new file: board/st/stls/ide.c new file: board/st/stls/pci.c diff --git a/board/st/stls/flash.c b/board/st/stls/flash.c new file mode 100755 index 000..1afee80 --- /dev/null +++ b/board/st/stls/flash.c @@ -0,0 +1,626 @@ +/* + * (C) Copyright 2006 + * Stefan Roese, DENX Software Engineering, [EMAIL PROTECTED] + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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 +#include asm/processor.h +#include flash.h + +#ifndef CFG_FLASH_READ0 +#define CFG_FLASH_READ00x /* 0 is standard */ +#define CFG_FLASH_READ10x0001 /* 1 is standard */ +#define CFG_FLASH_READ20x0002 /* 2 is standard */ +#endif + +flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ + +/* + * Functions + */ +static int write_word(flash_info_t *info, ulong dest, ulong data); +static ulong flash_get_size(vu_long *addr, flash_info_t *info); + +unsigned long flash_init(void) +{ + unsigned long size_b0; + int i; + unsigned long base_b0; + + /* Init: no FLASHes known */ + for (i = 0; i CFG_MAX_FLASH_BANKS; ++i) { + flash_info[i].flash_id = FLASH_UNKNOWN; + } + + /* Static FLASH Bank configuration here - FIXME XXX */ + + base_b0 = CFG_FLASH_BASE; + size_b0 = flash_get_size ((vu_long *) base_b0, flash_info[0]); + + if (flash_info[0].flash_id == FLASH_UNKNOWN) { + printf (## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n, + size_b0, size_b0 20); + } else { +#ifdef DEBUG_FLASH + flash_print_info(flash_info[0]); +#endif + } + return (size_b0); +} + +void flash_print_info(flash_info_t *info) +{ + int i; +#ifdef CFG_FLASH_EMPTY_INFO + int k; + int size; + int erased; + volatile unsigned long *flash; +#endif + + if (info-flash_id == FLASH_UNKNOWN) { + printf (missing or unknown FLASH type\n); + return; + } + + switch (info-flash_id FLASH_VENDMASK) { + case FLASH_MAN_AMD: printf (AMD );break; + case FLASH_MAN_FUJ: printf (FUJITSU );break; + case FLASH_MAN_SST: printf (SST );break; + case FLASH_MAN_STM: printf (ST Micro);break; + case FLASH_MAN_EXCEL: printf (Excel Semiconductor ); break; + case FLASH_MAN_MX: printf (MXIC ); break; + default:printf (Unknown Vendor ); break; + } + + switch (info-flash_id FLASH_TYPEMASK) { + case FLASH_AM400B: printf (AM29LV400B (4 Mbit, bottom boot sect)\n); + break; + case FLASH_AM400T: printf (AM29LV400T (4 Mbit, top boot sector)\n); + break; + case FLASH_AM040: printf (AM29LV040B (4 Mbit, uniform sector size)\n); + break; + case FLASH_AM800B: printf (AM29LV800B (8 Mbit, bottom boot sect)\n); + break; + case FLASH_AM800T: printf (AM29LV800T (8 Mbit, top boot sector)\n); + break; + case FLASH_AM160B: printf (AM29LV160B (16 Mbit, bottom boot sect)\n); + break; + case FLASH_AM160T: printf (AM29LV160T (16 Mbit, top boot sector)\n); + break; + case FLASH_AM320T: printf (AM29LV320T (32 M, top sector)\n); + break; + case FLASH_AM320B: printf (AM29LV320B (32 M, bottom sector)\n); + break; + case FLASH_AMDL322T:printf (AM29DL322T (32 M, top sector)\n); + break; + case