Browse Source

* Fix get_partition_info() parameter error in all other calls
(common/cmd_ide.c, common/cmd_reiser.c, common/cmd_scsi.c).

* Enable USB and IDE support for INKA4x0 board

* Patch by Andrew Dyer, 28 February 2005:
fix ext2load passing an incorrect pointer to get_partition_info()
resulting in load failure for devices other than 0

wdenk 20 years ago
parent
commit
b05dcb58fe
8 changed files with 85 additions and 8 deletions
  1. 9 0
      CHANGELOG
  2. 29 0
      board/inka4x0/inka4x0.c
  3. 4 1
      common/cmd_ext2.c
  4. 1 1
      common/cmd_ide.c
  5. 1 1
      common/cmd_reiser.c
  6. 1 1
      common/cmd_scsi.c
  7. 1 4
      fs/ext2/dev.c
  8. 39 0
      include/configs/inka4x0.h

+ 9 - 0
CHANGELOG

@@ -5,6 +5,15 @@ Changes for U-Boot 1.1.3:
 * Patch by Stefan Roese, 01 March 2005:
   Update for esd boards dp405 and hub405
 
+* Fix get_partition_info() parameter error in all other calls
+  (common/cmd_ide.c, common/cmd_reiser.c, common/cmd_scsi.c).
+
+* Enable USB and IDE support for INKA4x0 board
+
+* Patch by Andrew Dyer, 28 February 2005:
+  fix ext2load passing an incorrect pointer to get_partition_info()
+  resulting in load failure for devices other than 0
+
 * Add support for SRAM and 2 x Quad UARTs on INKA4x0 board
 
 * Cleanup USB and partition defines

+ 29 - 0
board/inka4x0/inka4x0.c

@@ -200,3 +200,32 @@ void pci_init_board(void)
         pci_mpc5xxx_init(&hose);
 }
 #endif
+
+#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+
+#define GPIO_PSC1_4	0x01000000UL
+
+void init_ide_reset (void)
+{
+	debug ("init_ide_reset\n");
+
+    	/* Configure PSC1_4 as GPIO output for ATA reset */
+	*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
+	*(vu_long *) MPC5XXX_WU_GPIO_DIR    |= GPIO_PSC1_4;
+	/* Deassert reset */
+	*(vu_long *) MPC5XXX_WU_GPIO_DATA   |= GPIO_PSC1_4;
+}
+
+void ide_set_reset (int idereset)
+{
+	debug ("ide_reset(%d)\n", idereset);
+
+	if (idereset) {
+		*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
+		/* Make a delay. MPC5200 spec says 25 usec min */
+		udelay(500000);
+	} else {
+		*(vu_long *) MPC5XXX_WU_GPIO_DATA |=  GPIO_PSC1_4;
+	}
+}
+#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */

+ 4 - 1
common/cmd_ext2.c

@@ -41,6 +41,9 @@
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
 #include <ext2fs.h>
+#if ((CONFIG_COMMANDS & CFG_CMD_USB) && defined(CONFIG_USB_STORAGE))
+#include <usb.h>
+#endif
 
 #ifndef CONFIG_DOS_PARTITION
 #error DOS partition support must be selected
@@ -223,7 +226,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	PRINTF("Using device %s%d, partition %d\n", argv[1], dev, part);
 
 	if (part != 0) {
-		if (get_partition_info (&dev_desc[dev], part, &info)) {
+		if (get_partition_info (dev_desc, part, &info)) {
 			printf ("** Bad partition %d **\n", part);
 			return(1);
 		}

+ 1 - 1
common/cmd_ide.c

@@ -413,7 +413,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+	if (get_partition_info (ide_dev_desc, part, &info)) {
 		SHOW_BOOT_PROGRESS (-1);
 		return 1;
 	}

+ 1 - 1
common/cmd_reiser.c

@@ -212,7 +212,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	PRINTF("Using device %s%d, partition %d\n", argv[1], dev, part);
 
 	if (part != 0) {
-		if (get_partition_info (&dev_desc[dev], part, &info)) {
+		if (get_partition_info (dev_desc, part, &info)) {
 			printf ("** Bad partition %d **\n", part);
 			return 1;
 		}

+ 1 - 1
common/cmd_scsi.c

@@ -243,7 +243,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
+	if (get_partition_info (scsi_dev_desc, part, &info)) {
 		printf("error reading partinfo\n");
 		return 1;
 	}

+ 1 - 4
fs/ext2/dev.c

@@ -33,7 +33,6 @@
 static block_dev_desc_t *ext2fs_block_dev_desc;
 static disk_partition_t part_info;
 
-#undef DEBUG
 int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int part)
 {
 	ext2fs_block_dev_desc = rbdd;
@@ -74,9 +73,7 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
 	sector += byte_offset >> SECTOR_BITS;
 	byte_offset &= SECTOR_SIZE - 1;
 
-#if defined(DEBUG)
-	printf (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
-#endif
+	debug (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
 
 	if (ext2fs_block_dev_desc == NULL) {
 		printf ("** Invalid Block Device Descriptor (NULL)\n");

+ 39 - 0
include/configs/inka4x0.h

@@ -80,12 +80,17 @@
  * Supported commands
  */
 #define CONFIG_COMMANDS	       (CONFIG_CMD_DFL	| \
+				CFG_CMD_EXT2	| \
+				CFG_CMD_FAT	| \
+				CFG_CMD_IDE	| \
 				CFG_CMD_PCI	| \
 				CFG_CMD_USB	)
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
+#define	CONFIG_TIMESTAMP	1	/* Print image info with timestamp */
+
 #if (TEXT_BASE == 0xFFE00000)		/* Boot low */
 #   define CFG_LOWBOOT		1
 #endif
@@ -281,4 +286,38 @@
 #define CONFIG_USB_CONFIG	0x00001000
 #define CONFIG_USB_STORAGE
 
+/*-----------------------------------------------------------------------
+ * IDE/ATA stuff Supports IDE harddisk
+ *-----------------------------------------------------------------------
+ */
+
+#undef  CONFIG_IDE_8xx_PCCARD		/* Use IDE with PC Card	Adapter	*/
+
+#undef	CONFIG_IDE_8xx_DIRECT		/* Direct IDE    not supported	*/
+#undef	CONFIG_IDE_LED			/* LED   for ide not supported	*/
+
+#define	CONFIG_IDE_RESET		/* reset for ide supported	*/
+#define CONFIG_IDE_PREINIT
+
+#define CFG_IDE_MAXBUS		1	/* max. 1 IDE bus		*/
+#define CFG_IDE_MAXDEVICE	2	/* max. 1 drive per IDE bus	*/
+
+#define CFG_ATA_IDE0_OFFSET	0x0000
+
+#define CFG_ATA_BASE_ADDR	MPC5XXX_ATA
+
+/* Offset for data I/O			*/
+#define CFG_ATA_DATA_OFFSET	(0x0060)
+
+/* Offset for normal register accesses	*/
+#define CFG_ATA_REG_OFFSET	(CFG_ATA_DATA_OFFSET)
+
+/* Offset for alternate registers	*/
+#define CFG_ATA_ALT_OFFSET	(0x005C)
+
+/* Interval between registers                                                */
+#define CFG_ATA_STRIDE          4
+
+#define CONFIG_ATAPI            1
+
 #endif /* __CONFIG_H */