All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history
@ 2009-06-04 11:35 Stefan Roese
  2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Stefan Roese @ 2009-06-04 11:35 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 include/configs/CPCI750.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/configs/CPCI750.h b/include/configs/CPCI750.h
index 8494faa..3b0b888 100644
--- a/include/configs/CPCI750.h
+++ b/include/configs/CPCI750.h
@@ -76,7 +76,8 @@
 
 #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 
-#define CONFIG_AUTO_COMPLETE 1
+#define CONFIG_CMDLINE_EDITING		/* add command line history	*/
+#define CONFIG_AUTO_COMPLETE		/* add autocompletion support	*/
 
 /* Define which ETH port will be used for connecting the network */
 #define CONFIG_SYS_ETH_PORT		ETH_0
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command
  2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
@ 2009-06-04 11:35 ` Stefan Roese
  2009-06-04 17:40   ` Matthias Fuchs
  2009-06-12 12:53   ` Wolfgang Denk
  2009-06-04 11:35 ` [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c Stefan Roese
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Stefan Roese @ 2009-06-04 11:35 UTC (permalink / raw)
  To: u-boot

This command is used to load/boot an OS-image which is transferred from
the CPCI host to the CPCI target/adapter.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 board/esd/cpci750/cpci750.c |   76 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 4826633..3473504 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -122,6 +122,9 @@ static char show_config_tab[][15] = {{"PCI0DLL_2     "},  /* 31 */
 
 extern flash_info_t flash_info[];
 
+extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
+extern int do_bootvx (cmd_tbl_t *, int, int, char *[]);
+
 /* ------------------------------------------------------------------------- */
 
 /* this is the current GT register space location */
@@ -538,6 +541,79 @@ int display_mem_map (void)
 	return (0);
 }
 
+/*
+ * Command loadpci: wait for signal from host and boot image.
+ */
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	volatile unsigned int *ptr;
+	int count = 0;
+	int count2 = 0;
+	int status;
+	char addr[16];
+	char str[] = "\\|/-";
+	char *local_args[2];
+
+	/*
+	 * Mark sync address
+	 */
+	ptr = 0;
+	ptr[0] = 0xffffffff;
+	ptr[1] = 0xffffffff;
+	puts("\nWaiting for image from pci host -");
+
+	/*
+	 * Wait for host to write the start address
+	 */
+	while (*ptr == 0xffffffff) {
+		count++;
+		if (!(count % 100)) {
+			count2++;
+			putc(0x08); /* backspace */
+			putc(str[count2 % 4]);
+		}
+
+		/* Abort if ctrl-c was pressed */
+		if (ctrlc()) {
+			puts("\nAbort\n");
+			return 0;
+		}
+
+		udelay(1000);
+	}
+
+	sprintf(addr, "%08x", *ptr);
+	printf("\nBooting Image at addr 0x%s ...\n", addr);
+	setenv("loadaddr", addr);
+
+	switch (ptr[1] == 0) {
+	case 0:
+		/*
+		 * Boot image via bootm
+		 */
+		local_args[0] = argv[0];
+		local_args[1] = NULL;
+		status = do_bootm (cmdtp, 0, 1, local_args);
+		break;
+	case 1:
+		/*
+		 * Boot image via bootvx
+		 */
+		local_args[0] = argv[0];
+		local_args[1] = NULL;
+		status = do_bootvx (cmdtp, 0, 1, local_args);
+		break;
+	}
+
+	return 0;
+}
+
+U_BOOT_CMD(
+	loadpci,	1,	1,	do_loadpci,
+	"loadpci - Wait for pci-image and boot it\n",
+	NULL
+	);
+
 /* DRAM check routines copied from gw8260 */
 
 #if defined (CONFIG_SYS_DRAM_TEST)
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c
  2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
  2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
@ 2009-06-04 11:35 ` Stefan Roese
  2009-06-12 12:54   ` Wolfgang Denk
  2009-06-04 11:35 ` [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0 Stefan Roese
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Stefan Roese @ 2009-06-04 11:35 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 board/esd/cpci750/cpci750.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 3473504..69ae517 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -451,13 +451,12 @@ int misc_init_r ()
 
 void after_reloc (ulong dest_addr, gd_t * gd)
 {
+	memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE, CONFIG_SYS_BOOT_SIZE);
 
-  memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE, CONFIG_SYS_BOOT_SIZE);
-
-  display_mem_map ();
-  /* now, jump to the main ppcboot board init code */
-  board_init_r (gd, dest_addr);
-  /* NOTREACHED */
+	display_mem_map ();
+	/* now, jump to the main ppcboot board init code */
+	board_init_r (gd, dest_addr);
+	/* NOTREACHED */
 }
 
 /* ------------------------------------------------------------------------- */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0
  2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
  2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
  2009-06-04 11:35 ` [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c Stefan Roese
@ 2009-06-04 11:35 ` Stefan Roese
  2009-06-04 17:43   ` Matthias Fuchs
  2009-06-04 11:35 ` [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support Stefan Roese
  2009-06-12 12:52 ` [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Wolfgang Denk
  4 siblings, 1 reply; 13+ messages in thread
From: Stefan Roese @ 2009-06-04 11:35 UTC (permalink / raw)
  To: u-boot

The Marvell bridge 64360 supports serveral PCI functions, not only 0. This
patch enables access to those functions.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 board/esd/cpci750/cpci750.c |   16 +++++++++++-----
 board/esd/cpci750/pci.c     |   14 +++++++++-----
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 69ae517..18944ef 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -187,6 +187,7 @@ original ppcboot 1.1.6 source end */
 static void gt_pci_config (void)
 {
 	unsigned int stat;
+	unsigned int data;
 	unsigned int val = 0x00fff864;	/* DINK32: BusNum 23:16,  DevNum 15:11, FuncNum 10:8, RegNum 7:2 */
 
 	/* In PCIX mode devices provide their own bus and device numbers. We query the Discovery II's
@@ -254,10 +255,11 @@ static void gt_pci_config (void)
 
 /*ronen update the pci internal registers base address.*/
 #ifdef MAP_PCI
-	for (stat = 0; stat <= PCI_HOST1; stat++)
-		pciWriteConfigReg (stat,
-				   PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
-				   SELF, CONFIG_SYS_GT_REGS);
+	for (stat = 0; stat <= PCI_HOST1; stat++) {
+		data = pciReadConfigReg(stat, PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF);
+		data = (data & 0x0f) | CONFIG_SYS_GT_REGS;
+		pciWriteConfigReg (stat, PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF, data);
+	}
 #endif
 
 }
@@ -451,9 +453,13 @@ int misc_init_r ()
 
 void after_reloc (ulong dest_addr, gd_t * gd)
 {
-	memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE, CONFIG_SYS_BOOT_SIZE);
+	memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE,
+			      CONFIG_SYS_BOOT_SIZE);
 
 	display_mem_map ();
+	GT_REG_WRITE (PCI_0BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
+	GT_REG_WRITE (PCI_1BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
+
 	/* now, jump to the main ppcboot board init code */
 	board_init_r (gd, dest_addr);
 	/* NOTREACHED */
diff --git a/board/esd/cpci750/pci.c b/board/esd/cpci750/pci.c
index bfc7e55..3b59b16 100644
--- a/board/esd/cpci750/pci.c
+++ b/board/esd/cpci750/pci.c
@@ -768,11 +768,12 @@ static int gt_read_config_dword (struct pci_controller *hose,
 	int bus = PCI_BUS (dev);
 
 	if ((bus == local_buses[0]) || (bus == local_buses[1])) {
-		*value = pciReadConfigReg ((PCI_HOST) hose->cfg_addr, offset,
+	        *value = pciReadConfigReg ((PCI_HOST) hose->cfg_addr,
+					   offset | (PCI_FUNC(dev) << 8),
 					   PCI_DEV (dev));
 	} else {
-		*value = pciOverBridgeReadConfigReg ((PCI_HOST) hose->
-						     cfg_addr, offset,
+		*value = pciOverBridgeReadConfigReg ((PCI_HOST) hose->cfg_addr,
+						     offset | (PCI_FUNC(dev) << 8),
 						     PCI_DEV (dev), bus);
 	}
 
@@ -785,13 +786,16 @@ static int gt_write_config_dword (struct pci_controller *hose,
 	int bus = PCI_BUS (dev);
 
 	if ((bus == local_buses[0]) || (bus == local_buses[1])) {
-		pciWriteConfigReg ((PCI_HOST) hose->cfg_addr, offset,
+		pciWriteConfigReg ((PCI_HOST) hose->cfg_addr,
+				   offset | (PCI_FUNC(dev) << 8),
 				   PCI_DEV (dev), value);
 	} else {
 		pciOverBridgeWriteConfigReg ((PCI_HOST) hose->cfg_addr,
-					     offset, PCI_DEV (dev), bus,
+					     offset | (PCI_FUNC(dev) << 8),
+					     PCI_DEV (dev), bus,
 					     value);
 	}
+
 	return 0;
 }
 
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support
  2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
                   ` (2 preceding siblings ...)
  2009-06-04 11:35 ` [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0 Stefan Roese
@ 2009-06-04 11:35 ` Stefan Roese
  2009-06-12 12:56   ` Wolfgang Denk
  2009-06-12 12:52 ` [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Wolfgang Denk
  4 siblings, 1 reply; 13+ messages in thread
From: Stefan Roese @ 2009-06-04 11:35 UTC (permalink / raw)
  To: u-boot

The CPCI750 can be built as CPCI host or adapter/target board. This patch
adds support for runtime detection of those variants.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
---
 board/esd/cpci750/cpci750.c |    9 ++++++++
 board/esd/cpci750/ide.c     |    4 ++-
 board/esd/cpci750/pci.c     |   49 ++++++++++++++++++++++++++++++------------
 include/configs/CPCI750.h   |    2 +
 4 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 18944ef..1e76bc6 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -140,6 +140,15 @@ void board_prebootm_init (void);
 unsigned int INTERNAL_REG_BASE_ADDR = CONFIG_SYS_GT_REGS;
 int display_mem_map (void);
 
+/*
+ * Skip video initialization on slave variant.
+ * This function will overwrite the weak default in cfb_console.c
+ */
+int board_video_skip(void)
+{
+	return CPCI750_SLAVE_TEST;
+}
+
 /* ------------------------------------------------------------------------- */
 
 /*
diff --git a/board/esd/cpci750/ide.c b/board/esd/cpci750/ide.c
index 9bdc523..638219f 100644
--- a/board/esd/cpci750/ide.c
+++ b/board/esd/cpci750/ide.c
@@ -39,6 +39,8 @@ int ide_preinit (void)
 	int l;
 
 	status = 1;
+	if (CPCI750_SLAVE_TEST != 0)
+		return status;
 	for (l = 0; l < CONFIG_SYS_IDE_MAXBUS; l++) {
 		ide_bus_offset[l] = -ATA_STATUS;
 	}
@@ -57,7 +59,7 @@ int ide_preinit (void)
 		ide_bus_offset[1] &= 0xfffffffe;
 		ide_bus_offset[1] += CONFIG_SYS_PCI0_IO_SPACE;
 	}
-	return (status);
+	return status;
 }
 
 void ide_set_reset (int flag) {
diff --git a/board/esd/cpci750/pci.c b/board/esd/cpci750/pci.c
index 3b59b16..a2c1c50 100644
--- a/board/esd/cpci750/pci.c
+++ b/board/esd/cpci750/pci.c
@@ -795,7 +795,6 @@ static int gt_write_config_dword (struct pci_controller *hose,
 					     PCI_DEV (dev), bus,
 					     value);
 	}
-
 	return 0;
 }
 
@@ -807,6 +806,9 @@ static void gt_setup_ide (struct pci_controller *hose,
 	u32 bar_response, bar_value;
 	int bar;
 
+	if (CPCI750_SLAVE_TEST != 0)
+		return;
+
 	for (bar = 0; bar < 6; bar++) {
 		/*ronen different function for 3rd bank. */
 		unsigned int offset =
@@ -833,6 +835,9 @@ static void gt_setup_cpcidvi (struct pci_controller *hose,
 {
 	u32		  bar_value, pci_response;
 
+	if (CPCI750_SLAVE_TEST != 0)
+		return;
+
 	pci_hose_read_config_dword (hose, dev, PCI_COMMAND, &pci_response);
 	pci_hose_write_config_dword (hose, dev, PCI_BASE_ADDRESS_0, 0xffffffff);
 	pci_hose_read_config_dword (hose, dev, PCI_BASE_ADDRESS_0, &pci_response);
@@ -911,6 +916,7 @@ struct pci_controller pci1_hose = {
 void pci_init_board (void)
 {
 	unsigned int command;
+	unsigned int slave;
 #ifdef CONFIG_PCI_PNP
 	unsigned int bar;
 #endif
@@ -922,6 +928,8 @@ void pci_init_board (void)
 	gt_cpcidvi_rom.base = 0;
 #endif
 
+	slave = CPCI750_SLAVE_TEST;
+
 	pci0_hose.config_table = gt_config_table;
 	pci1_hose.config_table = gt_config_table;
 
@@ -957,27 +965,40 @@ void pci_init_board (void)
 	pci0_hose.cfg_addr = (unsigned int *) PCI_HOST0;
 
 	pci_register_hose (&pci0_hose);
-	pciArbiterEnable (PCI_HOST0);
-	pciParkingDisable (PCI_HOST0, 1, 1, 1, 1, 1, 1, 1);
-	command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
-	command |= PCI_COMMAND_MASTER;
-	pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
-	command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
-	command |= PCI_COMMAND_MEMORY;
-	pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
+	if (slave == 0) {
+		pciArbiterEnable (PCI_HOST0);
+		pciParkingDisable (PCI_HOST0, 1, 1, 1, 1, 1, 1, 1);
+		command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
+		command |= PCI_COMMAND_MASTER;
+		pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
+		command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
+		command |= PCI_COMMAND_MEMORY;
+		pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
 
 #ifdef CONFIG_PCI_PNP
-	pciauto_config_init(&pci0_hose);
-	pciauto_region_allocate(pci0_hose.pci_io, 0x400, &bar);
+		pciauto_config_init(&pci0_hose);
+		pciauto_region_allocate(pci0_hose.pci_io, 0x400, &bar);
 #endif
 #ifdef CONFIG_PCI_SCAN_SHOW
-	printf("PCI:   Bus Dev VenId DevId Class Int\n");
+		printf("PCI:   Bus Dev VenId DevId Class Int\n");
 #endif
-	pci0_hose.last_busno = pci_hose_scan_bus (&pci0_hose, pci0_hose.first_busno);
+		pci0_hose.last_busno = pci_hose_scan_bus (&pci0_hose,
+							  pci0_hose.first_busno);
 
 #ifdef DEBUG
-	gt_pci_bus_mode_display (PCI_HOST1);
+		gt_pci_bus_mode_display (PCI_HOST1);
 #endif
+	} else {
+		pciArbiterDisable (PCI_HOST0);
+		pciParkingDisable (PCI_HOST0, 1, 1, 1, 1, 1, 1, 1);
+		command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
+		command |= PCI_COMMAND_MASTER;
+		pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
+		command = pciReadConfigReg (PCI_HOST0, PCI_COMMAND, SELF);
+		command |= PCI_COMMAND_MEMORY;
+		pciWriteConfigReg (PCI_HOST0, PCI_COMMAND, SELF, command);
+		pci0_hose.last_busno = pci0_hose.first_busno;
+	}
 	pci1_hose.first_busno = pci0_hose.last_busno + 1;
 	pci1_hose.last_busno = 0xff;
 	pci1_hose.current_busno = pci1_hose.first_busno;
diff --git a/include/configs/CPCI750.h b/include/configs/CPCI750.h
index 3b0b888..d516c3c 100644
--- a/include/configs/CPCI750.h
+++ b/include/configs/CPCI750.h
@@ -627,4 +627,6 @@
 
 #define CONFIG_SYS_BOARD_ASM_INIT	1
 
+#define CPCI750_SLAVE_TEST	(((in8(0xf0300000) & 0x80) == 0) ? 0 : 1)
+
 #endif	/* __CONFIG_H */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command
  2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
@ 2009-06-04 17:40   ` Matthias Fuchs
  2009-06-05  3:39     ` Stefan Roese
  2009-06-12 12:53   ` Wolfgang Denk
  1 sibling, 1 reply; 13+ messages in thread
From: Matthias Fuchs @ 2009-06-04 17:40 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

doen't it make sense to use/extend the code from board/esd/common/cmd_loadpci.c
in stead it copying this code? Even that code is running on 4xx only, it should be simple
to modify it for cpci750. Adding support for bootvx should be simple also.

Matthias

> This command is used to load/boot an OS-image which is transferred from
> the CPCI host to the CPCI target/adapter.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/cpci750/cpci750.c |   76 +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 76 insertions(+), 0 deletions(-)
> 
> diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
> index 4826633..3473504 100644
> --- a/board/esd/cpci750/cpci750.c
> +++ b/board/esd/cpci750/cpci750.c
> @@ -122,6 +122,9 @@ static char show_config_tab[][15] = {{"PCI0DLL_2     "},  /* 31 */
>  
>  extern flash_info_t flash_info[];
>  
> +extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
> +extern int do_bootvx (cmd_tbl_t *, int, int, char *[]);
> +
>  /* ------------------------------------------------------------------------- */
>  
>  /* this is the current GT register space location */
> @@ -538,6 +541,79 @@ int display_mem_map (void)
>  	return (0);
>  }
>  
> +/*
> + * Command loadpci: wait for signal from host and boot image.
> + */
> +int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +	volatile unsigned int *ptr;
> +	int count = 0;
> +	int count2 = 0;
> +	int status;
> +	char addr[16];
> +	char str[] = "\\|/-";
> +	char *local_args[2];
> +
> +	/*
> +	 * Mark sync address
> +	 */
> +	ptr = 0;
> +	ptr[0] = 0xffffffff;
> +	ptr[1] = 0xffffffff;
> +	puts("\nWaiting for image from pci host -");
> +
> +	/*
> +	 * Wait for host to write the start address
> +	 */
> +	while (*ptr == 0xffffffff) {
> +		count++;
> +		if (!(count % 100)) {
> +			count2++;
> +			putc(0x08); /* backspace */
> +			putc(str[count2 % 4]);
> +		}
> +
> +		/* Abort if ctrl-c was pressed */
> +		if (ctrlc()) {
> +			puts("\nAbort\n");
> +			return 0;
> +		}
> +
> +		udelay(1000);
> +	}
> +
> +	sprintf(addr, "%08x", *ptr);
> +	printf("\nBooting Image at addr 0x%s ...\n", addr);
> +	setenv("loadaddr", addr);
> +
> +	switch (ptr[1] == 0) {
> +	case 0:
> +		/*
> +		 * Boot image via bootm
> +		 */
> +		local_args[0] = argv[0];
> +		local_args[1] = NULL;
> +		status = do_bootm (cmdtp, 0, 1, local_args);
> +		break;
> +	case 1:
> +		/*
> +		 * Boot image via bootvx
> +		 */
> +		local_args[0] = argv[0];
> +		local_args[1] = NULL;
> +		status = do_bootvx (cmdtp, 0, 1, local_args);
> +		break;
> +	}
> +
> +	return 0;
> +}
> +
> +U_BOOT_CMD(
> +	loadpci,	1,	1,	do_loadpci,
> +	"loadpci - Wait for pci-image and boot it\n",
> +	NULL
> +	);
> +
>  /* DRAM check routines copied from gw8260 */
>  
>  #if defined (CONFIG_SYS_DRAM_TEST)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0
  2009-06-04 11:35 ` [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0 Stefan Roese
@ 2009-06-04 17:43   ` Matthias Fuchs
  0 siblings, 0 replies; 13+ messages in thread
From: Matthias Fuchs @ 2009-06-04 17:43 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

see one comment below.
> The Marvell bridge 64360 supports serveral PCI functions, not only 0. This
> patch enables access to those functions.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/cpci750/cpci750.c |   16 +++++++++++-----
>  board/esd/cpci750/pci.c     |   14 +++++++++-----
>  2 files changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
> index 69ae517..18944ef 100644
> --- a/board/esd/cpci750/cpci750.c
> +++ b/board/esd/cpci750/cpci750.c
> @@ -187,6 +187,7 @@ original ppcboot 1.1.6 source end */
>  static void gt_pci_config (void)
>  {
>  	unsigned int stat;
> +	unsigned int data;
>  	unsigned int val = 0x00fff864;	/* DINK32: BusNum 23:16,  DevNum 15:11, FuncNum 10:8, RegNum 7:2 */
>  
>  	/* In PCIX mode devices provide their own bus and device numbers. We query the Discovery II's
> @@ -254,10 +255,11 @@ static void gt_pci_config (void)
>  
>  /*ronen update the pci internal registers base address.*/
>  #ifdef MAP_PCI
> -	for (stat = 0; stat <= PCI_HOST1; stat++)
> -		pciWriteConfigReg (stat,
> -				   PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
> -				   SELF, CONFIG_SYS_GT_REGS);
> +	for (stat = 0; stat <= PCI_HOST1; stat++) {
> +		data = pciReadConfigReg(stat, PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF);
> +		data = (data & 0x0f) | CONFIG_SYS_GT_REGS;
> +		pciWriteConfigReg (stat, PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS, SELF, data);
Please break those long lines.

Matthias

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command
  2009-06-04 17:40   ` Matthias Fuchs
@ 2009-06-05  3:39     ` Stefan Roese
  2009-06-05 10:54       ` Matthias Fuchs
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Roese @ 2009-06-05  3:39 UTC (permalink / raw)
  To: u-boot

Hi Matthias,

On Thursday 04 June 2009 19:40:19 Matthias Fuchs wrote:
> doen't it make sense to use/extend the code from
> board/esd/common/cmd_loadpci.c in stead it copying this code? Even that
> code is running on 4xx only, it should be simple to modify it for cpci750.
> Adding support for bootvx should be simple also.

I thought about this too but didn't do it mainly because of those reasons:

a) As you already mentioned the current code in common is 4xx specific.

b) The parameters used to identify the image type are incompatible on
   both platforms. "1" is used for booting a script on 4xx and VxWorks
   on CPCI750.

c) I have no means of testing any changes in this code on 4xx and/or
   750.

So if you still think this should be unified then I need your assistance here. 
You would need to help me testing those changes on both platforms. Please let 
me know if you can do this.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command
  2009-06-05  3:39     ` Stefan Roese
@ 2009-06-05 10:54       ` Matthias Fuchs
  0 siblings, 0 replies; 13+ messages in thread
From: Matthias Fuchs @ 2009-06-05 10:54 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

please leave the code as is. It is already used in a project
and so modifying the parameter type may no change.

On Friday 05 June 2009 05:39, Stefan Roese wrote:
> Hi Matthias,
> 
> On Thursday 04 June 2009 19:40:19 Matthias Fuchs wrote:
> > doen't it make sense to use/extend the code from
> > board/esd/common/cmd_loadpci.c in stead it copying this code? Even that
> > code is running on 4xx only, it should be simple to modify it for cpci750.
> > Adding support for bootvx should be simple also.
> 
> I thought about this too but didn't do it mainly because of those reasons:
> 
> a) As you already mentioned the current code in common is 4xx specific.
But easy to adapt :-)
> 
> b) The parameters used to identify the image type are incompatible on
>    both platforms. "1" is used for booting a script on 4xx and VxWorks
>    on CPCI750.
> 
> c) I have no means of testing any changes in this code on 4xx and/or
>    750.
> 
> So if you still think this should be unified then I need your assistance here. 
Of course I can do such testing on 4xx hardware. 
> You would need to help me testing those changes on both platforms. Please let 
> me know if you can do this.

But let's shutdown this discussion.

Matthias

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history
  2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
                   ` (3 preceding siblings ...)
  2009-06-04 11:35 ` [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support Stefan Roese
@ 2009-06-12 12:52 ` Wolfgang Denk
  4 siblings, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2009-06-12 12:52 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <1244115339-19862-1-git-send-email-sr@denx.de> you wrote:
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  include/configs/CPCI750.h |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied to next. Thanks.

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: wd at denx.de
You might not be as stupid as you look. This is not hard. Let's think
about this. I mean ... I'll think about this, and  you  can  join  in
when you know the words.             - Terry Pratchett, _Men at Arms_

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command
  2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
  2009-06-04 17:40   ` Matthias Fuchs
@ 2009-06-12 12:53   ` Wolfgang Denk
  1 sibling, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2009-06-12 12:53 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <1244115339-19862-2-git-send-email-sr@denx.de> you wrote:
> This command is used to load/boot an OS-image which is transferred from
> the CPCI host to the CPCI target/adapter.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/cpci750/cpci750.c |   76 +++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 76 insertions(+), 0 deletions(-)

Applied to next, thanks.

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: wd at denx.de
You've no idea of what a poor opinion  I  have  of  myself,  and  how
little I deserve it.                                  - W. S. Gilbert

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c
  2009-06-04 11:35 ` [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c Stefan Roese
@ 2009-06-12 12:54   ` Wolfgang Denk
  0 siblings, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2009-06-12 12:54 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <1244115339-19862-3-git-send-email-sr@denx.de> you wrote:
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/cpci750/cpci750.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)

Applied to next, thanks.

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: wd at denx.de
"Buy land. They've stopped making it."                   - Mark Twain

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support
  2009-06-04 11:35 ` [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support Stefan Roese
@ 2009-06-12 12:56   ` Wolfgang Denk
  0 siblings, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2009-06-12 12:56 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <1244115339-19862-5-git-send-email-sr@denx.de> you wrote:
> The CPCI750 can be built as CPCI host or adapter/target board. This patch
> adds support for runtime detection of those variants.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
> ---
>  board/esd/cpci750/cpci750.c |    9 ++++++++
>  board/esd/cpci750/ide.c     |    4 ++-
>  board/esd/cpci750/pci.c     |   49 ++++++++++++++++++++++++++++++------------
>  include/configs/CPCI750.h   |    2 +
>  4 files changed, 49 insertions(+), 15 deletions(-)

Applied to next, thanks.

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: wd at denx.de
You are an excellent tactician, Captain. You let your second in  com-
mand attack while you sit and watch for weakness.
	-- Khan Noonian Singh, "Space Seed", stardate 3141.9

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-06-12 12:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04 11:35 [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Stefan Roese
2009-06-04 11:35 ` [U-Boot] [PATCH 2/5] 74xx_7xx: CPCI750: Add loadpci command Stefan Roese
2009-06-04 17:40   ` Matthias Fuchs
2009-06-05  3:39     ` Stefan Roese
2009-06-05 10:54       ` Matthias Fuchs
2009-06-12 12:53   ` Wolfgang Denk
2009-06-04 11:35 ` [U-Boot] [PATCH 3/5] 74xx_7xx: CPCI750: Minor coding style cleanup of cpci750.c Stefan Roese
2009-06-12 12:54   ` Wolfgang Denk
2009-06-04 11:35 ` [U-Boot] [PATCH 4/5] 74xx_7xx: CPCI750: Enable access to PCI function > 0 Stefan Roese
2009-06-04 17:43   ` Matthias Fuchs
2009-06-04 11:35 ` [U-Boot] [PATCH 5/5] 74xx_7xx: CPCI750: Add CPCI adapter/target support Stefan Roese
2009-06-12 12:56   ` Wolfgang Denk
2009-06-12 12:52 ` [U-Boot] [PATCH 1/5] 74xx_7xx: CPCI750: Add commandline editing/history Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.