public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation
@ 2011-10-13 13:12 matthias.fuchs at esd.eu
  2011-10-13 13:12 ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register matthias.fuchs at esd.eu
  2011-12-01  8:12 ` [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation Stefan Roese
  0 siblings, 2 replies; 6+ messages in thread
From: matthias.fuchs at esd.eu @ 2011-10-13 13:12 UTC (permalink / raw)
  To: u-boot

From: Matthias Fuchs <matthias.fuchs@esd.eu>

This patch switches PMC440 board code to the CONFIG_PCI_BOOTDELAY option
instead of using a private implemention. This relies on Anatolji's patch
that moves the pcidelay handling behind pci_target_init.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
 board/esd/pmc440/pmc440.c |   15 ---------------
 include/configs/PMC440.h  |    2 ++
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c
index 5236f44..0d56064 100644
--- a/board/esd/pmc440/pmc440.c
+++ b/board/esd/pmc440/pmc440.c
@@ -617,21 +617,6 @@ void pci_master_init(struct pci_controller *hose)
 
 static void wait_for_pci_ready(void)
 {
-	int i;
-	char *s = getenv("pcidelay");
-	/*
-	 * We have our own handling of the pcidelay variable.
-	 * Using CONFIG_PCI_BOOTDELAY enables pausing for host
-	 * and adapter devices. For adapter devices we do not
-	 * want this.
-	 */
-	if (s) {
-		int ms = simple_strtoul(s, NULL, 10);
-		printf("PCI:   Waiting for %d ms\n", ms);
-		for (i=0; i<ms; i++)
-			udelay(1000);
-	}
-
 	if (!(in_be32((void*)GPIO1_IR) & GPIO1_PPC_EREADY)) {
 		printf("PCI:   Waiting for EREADY (CTRL-C to skip) ... ");
 		while (1) {
diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index bee74aa..ed47a87 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -432,6 +432,8 @@
 #define CONFIG_SYS_PCI_MASTER_INIT
 #define CONFIG_SYS_PCI_BOARD_FIXUP_IRQ
 
+#define CONFIG_PCI_BOOTDELAY 0
+
 /* PCI identification */
 #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x12FE	/* PCI Vendor ID: esd gmbh      */
 #define CONFIG_SYS_PCI_SUBSYS_ID_NONMONARCH 0x0441	/* PCI Device ID: Non-Monarch */
-- 
1.6.1

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

* [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register
  2011-10-13 13:12 [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation matthias.fuchs at esd.eu
@ 2011-10-13 13:12 ` matthias.fuchs at esd.eu
  2011-10-13 13:12   ` [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command matthias.fuchs at esd.eu
  2011-12-01  8:12   ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register Stefan Roese
  2011-12-01  8:12 ` [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation Stefan Roese
  1 sibling, 2 replies; 6+ messages in thread
From: matthias.fuchs at esd.eu @ 2011-10-13 13:12 UTC (permalink / raw)
  To: u-boot

From: Matthias Fuchs <matthias.fuchs@esd.eu>

This patch removes an invalid call to pci_write_config_dword to
PCI_BRDGOPT2 register. This function must not be used from pci_target_init
and is also at the wrong place. The correct call is done later in
pci_target_init via pci_hose_write_config_dword.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
 board/esd/pmc440/pmc440.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c
index 0d56064..3713e37 100644
--- a/board/esd/pmc440/pmc440.c
+++ b/board/esd/pmc440/pmc440.c
@@ -574,8 +574,6 @@ void pci_target_init(struct pci_controller *hose)
 	/* No error reporting */
 	pci_hose_write_config_word(hose, 0, PCI_ERREN, 0);
 
-	pci_write_config_dword(0, PCI_BRDGOPT2, 0x00000101);
-
 	if (!is_monarch()) {
 		/* Program the board's subsystem id/classcode */
 		pci_hose_write_config_word(hose, 0, PCI_SUBSYSTEM_ID,
-- 
1.6.1

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

* [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command
  2011-10-13 13:12 ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register matthias.fuchs at esd.eu
@ 2011-10-13 13:12   ` matthias.fuchs at esd.eu
  2011-11-22  7:33     ` Stefan Roese
  2011-12-01  8:12   ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register Stefan Roese
  1 sibling, 1 reply; 6+ messages in thread
From: matthias.fuchs at esd.eu @ 2011-10-13 13:12 UTC (permalink / raw)
  To: u-boot

From: Matthias Fuchs <matthias.fuchs@esd.eu>

This patch fixes the PMC440 BSP command painit. The implementation was
broken since the step to the new environment handling.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
 board/esd/pmc440/cmd_pmc440.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
index 200d7ee..3bcf2b0 100644
--- a/board/esd/pmc440/cmd_pmc440.c
+++ b/board/esd/pmc440/cmd_pmc440.c
@@ -342,7 +342,8 @@ U_BOOT_CMD(
 
 #if defined(CONFIG_PRAM)
 #include <environment.h>
-extern env_t *env_ptr;
+#include <search.h>
+#include <errno.h>
 
 int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
@@ -351,6 +352,10 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	u32 param;
 	ulong *lptr;
 
+	env_t *envp;
+	char *res;
+	int len;
+
 	v = getenv("pram");
 	if (v)
 		pram = simple_strtoul(v, NULL, 10);
@@ -384,7 +389,15 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	/* env is first (4k aligned) */
 	nextbase -= ((CONFIG_ENV_SIZE + 4096 - 1) & ~(4096 - 1));
-	memcpy((void*)nextbase, env_ptr, CONFIG_ENV_SIZE);
+	envp = (env_t *)nextbase;
+	res = (char *)envp->data;
+	len = hexport_r(&env_htab, '\0', &res, ENV_SIZE);
+        if (len < 0) {
+                error("Cannot export environment: errno = %d\n", errno);
+                return 1;
+        }
+	envp->crc = crc32(0, envp->data, ENV_SIZE);
+
 	*(--lptr) = CONFIG_ENV_SIZE;     /* size */
 	*(--lptr) = base - nextbase;  /* offset | type=0 */
 
-- 
1.6.1

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

* [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command
  2011-10-13 13:12   ` [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command matthias.fuchs at esd.eu
@ 2011-11-22  7:33     ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2011-11-22  7:33 UTC (permalink / raw)
  To: u-boot

Hi Matthias,

On Thursday 13 October 2011 15:12:24 matthias.fuchs at esd.eu wrote:
> From: Matthias Fuchs <matthias.fuchs@esd.eu>
> 
> This patch fixes the PMC440 BSP command painit. The implementation was
> broken since the step to the new environment handling.

After applying this patch to the latest U-Boot version I get the following 
error:

[stefan at kubuntu u-boot-ppc4xx (master)]$ ./MAKEALL PMC440 
Configuring for PMC440 board...
cmd_pmc440.c: In function 'do_painit':
cmd_pmc440.c:394: error: too few arguments to function 'hexport_r'
make[1]: *** [cmd_pmc440.o] Error 1

Seems that the hexport_r() API has changed. Could you please take a look and 
resubmit.

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] 6+ messages in thread

* [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation
  2011-10-13 13:12 [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation matthias.fuchs at esd.eu
  2011-10-13 13:12 ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register matthias.fuchs at esd.eu
@ 2011-12-01  8:12 ` Stefan Roese
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2011-12-01  8:12 UTC (permalink / raw)
  To: u-boot

On Thursday 13 October 2011 15:12:22 matthias.fuchs at esd.eu wrote:
> From: Matthias Fuchs <matthias.fuchs@esd.eu>
> 
> This patch switches PMC440 board code to the CONFIG_PCI_BOOTDELAY option
> instead of using a private implemention. This relies on Anatolji's patch
> that moves the pcidelay handling behind pci_target_init.

Applied to u-boot-ppc4xx. 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] 6+ messages in thread

* [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register
  2011-10-13 13:12 ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register matthias.fuchs at esd.eu
  2011-10-13 13:12   ` [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command matthias.fuchs at esd.eu
@ 2011-12-01  8:12   ` Stefan Roese
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2011-12-01  8:12 UTC (permalink / raw)
  To: u-boot

On Thursday 13 October 2011 15:12:23 matthias.fuchs at esd.eu wrote:
> From: Matthias Fuchs <matthias.fuchs@esd.eu>
> 
> This patch removes an invalid call to pci_write_config_dword to
> PCI_BRDGOPT2 register. This function must not be used from pci_target_init
> and is also at the wrong place. The correct call is done later in
> pci_target_init via pci_hose_write_config_dword.

Applied to u-boot-ppc4xx. 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] 6+ messages in thread

end of thread, other threads:[~2011-12-01  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 13:12 [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation matthias.fuchs at esd.eu
2011-10-13 13:12 ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register matthias.fuchs at esd.eu
2011-10-13 13:12   ` [U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command matthias.fuchs at esd.eu
2011-11-22  7:33     ` Stefan Roese
2011-12-01  8:12   ` [U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register Stefan Roese
2011-12-01  8:12 ` [U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox