public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f()
@ 2014-04-28 22:52 York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 2/4] powerpc/freescale: Change the return value of mac_read_from_eeprom() York Sun
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: York Sun @ 2014-04-28 22:52 UTC (permalink / raw)
  To: u-boot

The pointer of device tree comes from r3 for QEMU. This is not the case
for normal SoCs out of reset. Having gd->fdt_blob as 0 is important for
other functions to detect the non-existence of device tree.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
index 998781b..47b712d 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -102,11 +102,13 @@ void cpu_init_early_f(void *fdt)
 	for (i = 0; i < sizeof(gd_t); i++)
 		((char *)gd)[i] = 0;
 
+#ifdef CONFIG_QEMU_E500
 	/*
 	 * CONFIG_SYS_CCSRBAR_PHYS below may use gd->fdt_blob on ePAPR systems,
 	 * so we need to populate it before it accesses it.
 	 */
 	gd->fdt_blob = fdt;
+#endif
 
 	mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(13);
 	mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_TS | MAS1_TSIZE(BOOKE_PAGESZ_1M);
-- 
1.7.9.5

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

* [U-Boot] [PATCH 2/4] powerpc/freescale: Change the return value of mac_read_from_eeprom()
  2014-04-28 22:52 [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() York Sun
@ 2014-04-28 22:52 ` York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 3/4] powerpc/mpc85xx: Fix argument for calling board_init_f York Sun
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: York Sun @ 2014-04-28 22:52 UTC (permalink / raw)
  To: u-boot

The return value has not been checked by its caller, until recent change
of using generic board architecture. The error of this function is not
critical enough to hang the system. Printing the warning message is enough
to catch user's attention. U-boot should continue to boot to give user
a chance to fix the EEPROM. Chaning the return value to 0 to avoid hanging
in the board_init_r().

Signed-off-by: York Sun <yorksun@freescale.com>
---
 board/freescale/common/sys_eeprom.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index 9c18dd8..33a5a5a 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -425,13 +425,13 @@ int mac_read_from_eeprom(void)
 
 	if (read_eeprom()) {
 		printf("Read failed.\n");
-		return -1;
+		return 0;
 	}
 
 	if (!is_valid) {
 		printf("Invalid ID (%02x %02x %02x %02x)\n",
 		       e.id[0], e.id[1], e.id[2], e.id[3]);
-		return -1;
+		return 0;
 	}
 
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
@@ -447,7 +447,7 @@ int mac_read_from_eeprom(void)
 	crcp = (void *)&e + crc_offset;
 	if (crc != be32_to_cpu(*crcp)) {
 		printf("CRC mismatch (%08x != %08x)\n", crc, be32_to_cpu(e.crc));
-		return -1;
+		return 0;
 	}
 
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
-- 
1.7.9.5

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

* [U-Boot] [PATCH 3/4] powerpc/mpc85xx: Fix argument for calling board_init_f
  2014-04-28 22:52 [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 2/4] powerpc/freescale: Change the return value of mac_read_from_eeprom() York Sun
@ 2014-04-28 22:52 ` York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 4/4] powerpc/freescale: Convert selected boards to generic board architecture York Sun
  2014-04-29  9:01 ` [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: York Sun @ 2014-04-28 22:52 UTC (permalink / raw)
  To: u-boot

baord_init_f takes one argument. It has not been used for powerpc, until
recently changing to use generic board architecture.

Signed-off-by: York Sun <yorksun@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/start.S |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 0e3c86a..5f6f97b 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1159,6 +1159,7 @@ _start_cont:
 	isync
 
 	bl	cpu_init_f
+	li	r3, 0
 	bl	board_init_f
 	isync
 
-- 
1.7.9.5

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

* [U-Boot] [PATCH 4/4] powerpc/freescale: Convert selected boards to generic board architecture
  2014-04-28 22:52 [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 2/4] powerpc/freescale: Change the return value of mac_read_from_eeprom() York Sun
  2014-04-28 22:52 ` [U-Boot] [PATCH 3/4] powerpc/mpc85xx: Fix argument for calling board_init_f York Sun
@ 2014-04-28 22:52 ` York Sun
  2014-04-29  9:01 ` [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: York Sun @ 2014-04-28 22:52 UTC (permalink / raw)
  To: u-boot

This patch converts the following boards to use generic board: MPC8536DS,
MPC8572DS, MPC8641HPCN, p1_p2_rdb_pc, corenet_ds, t4qds, B4860QDS. It has
been tested on NOR boot on MPC8536DS, MPC8572DS, P1021RDB, P4080DS,
P5020DS, P5040DS, P3041DS, T4240QDS, B4860QDS.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Ying Zhang <b40530@freescale.com>
CC: Prabhakar Kushwaha <prabhakar@freescale.com>
CC: Haijun.Zhang <Haijun.Zhang@freescale.com>
CC: Scott Wood <scottwood@freescale.com>
CC: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 include/configs/B4860QDS.h     |    3 +++
 include/configs/MPC8536DS.h    |    2 ++
 include/configs/MPC8572DS.h    |    3 +++
 include/configs/MPC8641HPCN.h  |    3 +++
 include/configs/corenet_ds.h   |    3 +++
 include/configs/p1_p2_rdb_pc.h |    3 +++
 include/configs/t4qds.h        |    2 ++
 7 files changed, 19 insertions(+)

diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index df371b7..e0c08dc 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -7,6 +7,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 /*
  * B4860 QDS board configuration file
  */
diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index f15e162..72f5fde 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -11,6 +11,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #include "../board/freescale/common/ics307_clk.h"
 
 #ifdef CONFIG_36BIT
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 3a30feb..48ae9d4 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -11,6 +11,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #include "../board/freescale/common/ics307_clk.h"
 
 #ifdef CONFIG_36BIT
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 7443ace..a0d7d52 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -16,6 +16,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 /* High Level Configuration Options */
 #define CONFIG_MPC8641		1	/* MPC8641 specific */
 #define CONFIG_MPC8641HPCN	1	/* MPC8641HPCN board specific */
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index db6b9be..c8b7c2d 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -10,6 +10,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #include "../board/freescale/common/ics307_clk.h"
 
 #ifdef CONFIG_RAMBOOT_PBL
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index e745945..56b638e 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -10,6 +10,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
+
 #ifdef CONFIG_36BIT
 #define CONFIG_PHYS_64BIT
 #endif
diff --git a/include/configs/t4qds.h b/include/configs/t4qds.h
index 36bc529..75609b9 100644
--- a/include/configs/t4qds.h
+++ b/include/configs/t4qds.h
@@ -10,6 +10,8 @@
 #ifndef __T4QDS_H
 #define __T4QDS_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_CMD_REGINFO
 
 /* High Level Configuration Options */
-- 
1.7.9.5

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

* [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f()
  2014-04-28 22:52 [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() York Sun
                   ` (2 preceding siblings ...)
  2014-04-28 22:52 ` [U-Boot] [PATCH 4/4] powerpc/freescale: Convert selected boards to generic board architecture York Sun
@ 2014-04-29  9:01 ` Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2014-04-29  9:01 UTC (permalink / raw)
  To: u-boot


On 29.04.14 00:52, York Sun wrote:
> The pointer of device tree comes from r3 for QEMU. This is not the case
> for normal SoCs out of reset. Having gd->fdt_blob as 0 is important for
> other functions to detect the non-existence of device tree.
>
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Alexander Graf <agraf@suse.de>

Acked-by: Alexander Graf <agraf@suse.de>


Alex

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

end of thread, other threads:[~2014-04-29  9:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 22:52 [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() York Sun
2014-04-28 22:52 ` [U-Boot] [PATCH 2/4] powerpc/freescale: Change the return value of mac_read_from_eeprom() York Sun
2014-04-28 22:52 ` [U-Boot] [PATCH 3/4] powerpc/mpc85xx: Fix argument for calling board_init_f York Sun
2014-04-28 22:52 ` [U-Boot] [PATCH 4/4] powerpc/freescale: Convert selected boards to generic board architecture York Sun
2014-04-29  9:01 ` [U-Boot] [PATCH 1/4] powerpc/mpc85xx: Ignore FDT pointer for non-QEMU in cpu_init_early_f() Alexander Graf

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