Skip to contentSkip to conversation

Enable CODEC POST with CFG_POST_CODEC rather than with CFG_POST_DSP.

PATCH New Wolfgang Denk 2 participants 18 messages Apr 22, 2008 – Apr 24, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable CODEC POST with CFG_POST_CODEC rather than with CFG_POST_DSP.

From: Yuri Tikhonov <[email protected]>

---
 post/tests.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
post/tests.c +1 -1
index 698f85c..ed4ef2b 100644
@@ -225,7 +225,7 @@ struct post_test post_list[] =
 	CFG_POST_DSP
     },
 #endif
-#if CONFIG_POST & CFG_POST_DSP
+#if CONFIG_POST & CFG_POST_CODEC
     {
 	"CODEC test",
 	"codec",
Signature · 1 line
1.5.4.2
#1 lore raw

PATCH 1/1 The patch adds new POST tests for the Lwmon5 board.

From: Yuri Tikhonov <[email protected]>

* External Watchdog test;
* dsPIC tests;
* FPGA test;
* GDC test;
* Sysmon tests.

---
 board/lwmon5/lwmon5.c        |   19 +++
 include/configs/lwmon5.h     |   92 ++++++++++++++-
 include/post.h               |    5 +
 include/ppc440.h             |    3 +
 post/board/lwmon5/Makefile   |   28 +++++
 post/board/lwmon5/dsp.c      |   58 +++++++++
 post/board/lwmon5/dspic.c    |  109 +++++++++++++++++
 post/board/lwmon5/fpga.c     |  104 ++++++++++++++++
 post/board/lwmon5/gdc.c      |   94 +++++++++++++++
 post/board/lwmon5/sysmon.c   |  265 ++++++++++++++++++++++++++++++++++++++++++
 post/board/lwmon5/watchdog.c |  132 +++++++++++++++++++++
 post/tests.c                 |   26 ++++
 12 files changed, 931 insertions(+), 4 deletions(-)
 create mode 100644 post/board/lwmon5/Makefile
 create mode 100644 post/board/lwmon5/dsp.c
 create mode 100644 post/board/lwmon5/dspic.c
 create mode 100644 post/board/lwmon5/fpga.c
 create mode 100644 post/board/lwmon5/gdc.c
 create mode 100644 post/board/lwmon5/sysmon.c
 create mode 100644 post/board/lwmon5/watchdog.c
board/lwmon5/lwmon5.c +19 -0
index 815c01f..73d5de5 100644
@@ -96,6 +96,25 @@ int board_early_init_f(void)
 
 	gpio_write_bit(CFG_GPIO_FLASH_WP, 1);
 
+#if CONFIG_POST & CFG_POST_BSPEC1
+	gpio_write_bit(CFG_GPIO_HIGHSIDE, 1);
+
+	reg = 0; /* reuse as counter */
+	out_be32((void *)CFG_DSPIC_TEST_ADDR,
+		in_be32((void *)CFG_DSPIC_TEST_ADDR)
+			& ~CFG_DSPIC_TEST_MASK);
+	while (!gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) {
+		udelay(1000);
+	}
+	gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);
+	if (gpio_read_in_bit(CFG_GPIO_DSPIC_READY)) {
+		/* set "boot error" flag */
+		out_be32((void *)CFG_DSPIC_TEST_ADDR,
+			in_be32((void *)CFG_DSPIC_TEST_ADDR) |
+			CFG_DSPIC_TEST_MASK);
+	}
+#endif
+
 	/*
 	 * Reset PHY's:
 	 * The PHY's need a 2nd reset pulse, since the MDIO address is latched
include/configs/lwmon5.h +88 -4

126 lines not on this page · raw message

include/post.h +5 -0
index c8062bb..12c0e92 100644
@@ -93,6 +93,11 @@ extern int post_hotkeys_pressed(void);
 #define CFG_POST_CODEC		0x00002000
 #define CFG_POST_FPU		0x00004000
 #define CFG_POST_ECC		0x00008000
+#define CFG_POST_BSPEC1		0x00010000
+#define CFG_POST_BSPEC2		0x00020000
+#define CFG_POST_BSPEC3		0x00040000
+#define CFG_POST_BSPEC4		0x00080000
+#define CFG_POST_BSPEC5		0x00100000
 
 #endif /* CONFIG_POST */
 
include/ppc440.h +3 -0
index 80dd332..6e3b68d 100644
@@ -1431,6 +1431,9 @@
 #define   SDR0_MFR_PKT_REJ_POL         0x00200000   /* Packet Reject Polarity */
 
 #define GPT0_COMP6			0x00000098
+#define GPT0_COMP5			0x00000094
+#define GPT0_COMP4			0x00000090
+#define GPT0_COMP3			0x0000008C
 
 #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define SDR0_USB2D0CR                 0x0320
post/board/lwmon5/Makefile new file +28 -0
new file mode 100644
index 0000000..5a92d1c
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2008 Dmitry Rakhchev, EmCraft Systems, rda at emcraft.com
+#
+# Developed for DENX Software Engineering GmbH
+#
+# 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
+
+LIB	= libpostlwmon5.a
+
+COBJS	= sysmon.o watchdog.o dspic.o fpga.o dsp.o gdc.o
+
+include $(TOPDIR)/post/rules.mk
post/board/lwmon5/dsp.c new file +58 -0

58 lines not on this page · raw message

post/board/lwmon5/dspic.c new file +109 -0

109 lines not on this page · raw message

post/board/lwmon5/fpga.c new file +104 -0

104 lines not on this page · raw message

post/board/lwmon5/gdc.c new file +94 -0

94 lines not on this page · raw message

post/board/lwmon5/sysmon.c new file +265 -0

265 lines not on this page · raw message

post/board/lwmon5/watchdog.c new file +132 -0

132 lines not on this page · raw message

post/tests.c +26 -0
index ed4ef2b..53d01e3 100644
@@ -48,6 +48,13 @@ extern int dsp_post_test (int flags);
 extern int codec_post_test (int flags);
 extern int ecc_post_test (int flags);
 
+extern int dspic_init_post_test (int flags);
+extern int dspic_post_test (int flags);
+extern int gdc_post_test (int flags);
+extern int fpga_post_test (int flags);
+extern int lwmon5_watchdog_post_test(int flags);
+extern int sysmon1_post_test(int flags);
+
 extern int sysmon_init_f (void);
 
 extern void sysmon_reloc (void);
@@ -68,6 +75,9 @@ struct post_test post_list[] =
     },
 #endif
 #if CONFIG_POST & CFG_POST_WATCHDOG
+#if defined(CONFIG_POST_WATCHDOG)
+	CONFIG_POST_WATCHDOG,
+#else
     {
 	"Watchdog timer test",
 	"watchdog",
@@ -79,6 +89,7 @@ struct post_test post_list[] =
 	CFG_POST_WATCHDOG
     },
 #endif
+#endif
 #if CONFIG_POST & CFG_POST_I2C
     {
 	"I2C test",
@@ -249,6 +260,21 @@ struct post_test post_list[] =
 	CFG_POST_ECC
     },
 #endif
+#if CONFIG_POST & CFG_POST_BSPEC1
+	CONFIG_POST_BSPEC1,
+#endif
+#if CONFIG_POST & CFG_POST_BSPEC2
+	CONFIG_POST_BSPEC2,
+#endif
+#if CONFIG_POST & CFG_POST_BSPEC3
+	CONFIG_POST_BSPEC3,
+#endif
+#if CONFIG_POST & CFG_POST_BSPEC4
+	CONFIG_POST_BSPEC4,
+#endif
+#if CONFIG_POST & CFG_POST_BSPEC4
+	CONFIG_POST_BSPEC5,
+#endif
 };
 
 unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
Signature · 1 line
1.5.4.2
#2 lore raw

PATCH 1/1 The patch introduces the CRITICAL feature of POST tests. If the test

From: Yuri Tikhonov <[email protected]>

---
 common/main.c                        |    8 +++++++-
 include/asm-arm/global_data.h        |    1 +
 include/asm-avr32/global_data.h      |    1 +
 include/asm-blackfin/global_data.h   |    1 +
 include/asm-i386/global_data.h       |    1 +
 include/asm-m68k/global_data.h       |    1 +
 include/asm-microblaze/global_data.h |    1 +
 include/asm-mips/global_data.h       |    1 +
 include/asm-nios/global_data.h       |    1 +
 include/asm-nios2/global_data.h      |    1 +
 include/asm-ppc/global_data.h        |    1 +
 include/asm-sh/global_data.h         |    1 +
 include/post.h                       |    4 ++++
 post/post.c                          |   18 +++++++++++++++---
 14 files changed, 37 insertions(+), 4 deletions(-)
common/main.c +7 -1
index 163ba02..21e7afa 100644
@@ -40,7 +40,7 @@
 
 #include <post.h>
 
-#ifdef CONFIG_SILENT_CONSOLE
+#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST)
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
@@ -369,6 +369,12 @@ void main_loop (void)
 	init_cmd_timeout ();
 # endif	/* CONFIG_BOOT_RETRY_TIME */
 
+#ifdef CONFIG_POST
+	if (gd->flags & GD_FLG_POSTFAIL) {
+		s = getenv("failbootcmd");
+	}
+	else
+#endif /* CONFIG_POST */
 #ifdef CONFIG_BOOTCOUNT_LIMIT
 	if (bootlimit && (bootcount > bootlimit)) {
 		printf ("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n",
include/asm-arm/global_data.h +1 -0
index c2d5291..0410b5e 100644
@@ -60,6 +60,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
 
include/asm-avr32/global_data.h +1 -0
index 681c514..daf64bc 100644
@@ -51,6 +51,7 @@ typedef	struct	global_data {
 #define GD_FLG_RELOC	0x00001		/* Code was relocated to RAM	 */
 #define GD_FLG_DEVINIT	0x00002		/* Devices have been initialized */
 #define GD_FLG_SILENT	0x00004		/* Silent mode			 */
+#define GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed	 */
 
 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
 
include/asm-blackfin/global_data.h +1 -0
index cb0dfc2..6debfc7 100644
@@ -61,6 +61,7 @@ typedef struct global_data {
 #define	GD_FLG_RELOC	0x00001	/* Code was relocated to RAM     */
 #define	GD_FLG_DEVINIT	0x00002	/* Devices have been initialized */
 #define	GD_FLG_SILENT	0x00004	/* Silent mode                   */
+#define	GD_FLG_POSTFAIL	0x00008	/* Critical POST test failed     */
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t * volatile gd asm ("P5")
 
include/asm-i386/global_data.h +1 -0
index 1d309d5..68a9ad6 100644
@@ -54,6 +54,7 @@ typedef	struct {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 extern gd_t *global_data;
 
include/asm-m68k/global_data.h +1 -0
index 1e26eb0..958736e 100644
@@ -68,6 +68,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #if 0
 extern gd_t *global_data;
include/asm-microblaze/global_data.h +1 -0
index a6e7834..91243b2 100644
@@ -52,6 +52,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r31")
 
include/asm-mips/global_data.h +1 -0
index a024194..bd9e4dd 100644
@@ -54,6 +54,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM     */
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized */
 #define	GD_FLG_SILENT	0x00004		/* Silent mode			 */
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed	 */
 
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("k0")
 
include/asm-nios/global_data.h +1 -0
index fd11389..ddd66cf 100644
@@ -45,6 +45,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t *gd asm ("%g7")
 
include/asm-nios2/global_data.h +1 -0
index a1ac288..ae5f617 100644
@@ -44,6 +44,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #define DECLARE_GLOBAL_DATA_PTR     register gd_t *gd asm ("r15")
 
include/asm-ppc/global_data.h +1 -0
index 205f7ed..e07092b 100644
@@ -164,6 +164,7 @@ typedef	struct	global_data {
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #if 1
 #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r2")
include/asm-sh/global_data.h +1 -0
index 0a44a34..521a66f 100644
@@ -44,6 +44,7 @@ typedef	struct global_data
 #define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
 #define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
+#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
 #define DECLARE_GLOBAL_DATA_PTR	register gd_t *gd asm ("r13")
 
include/post.h +4 -0
index 12c0e92..ee07d2c 100644
@@ -42,12 +42,16 @@
 #define POST_REBOOT		0x0800	/* test may cause rebooting */
 #define POST_PREREL             0x1000  /* test runs before relocation */
 
+#define POST_CRITICAL		0x2000	/* Use failbootcmd if test failed */
+
 #define POST_MEM		(POST_RAM | POST_ROM)
 #define POST_ALWAYS		(POST_NORMAL	| \
 				 POST_SLOWTEST	| \
 				 POST_MANUAL	| \
 				 POST_POWERON	)
 
+#define POST_FAIL_SAVE		0x80
+
 #ifndef	__ASSEMBLY__
 
 struct post_test {
post/post.c +15 -3
index 4ff75ee..1df0657 100644
@@ -157,8 +157,10 @@ static void post_bootmode_test_off (void)
 
 static void post_get_flags (int *test_flags)
 {
-	int  flag[] = {  POST_POWERON,   POST_NORMAL,   POST_SLOWTEST };
-	char *var[] = { "post_poweron", "post_normal", "post_slowtest" };
+	int  flag[] = {  POST_POWERON,   POST_NORMAL,   POST_SLOWTEST,
+			 POST_CRITICAL };
+	char *var[] = { "post_poweron", "post_normal", "post_slowtest",
+			"post_critical" };
 	int varnum = sizeof (var) / sizeof (var[0]);
 	char list[128];			/* long enough for POST list */
 	char *name;
@@ -224,7 +226,9 @@ static int post_run_single (struct post_test *test,
 
 		if (!(flags & POST_REBOOT)) {
 			if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) {
-				post_bootmode_test_on (i);
+				post_bootmode_test_on (
+					(gd->flags & GD_FLG_POSTFAIL) ?
+						POST_FAIL_SAVE | i : i);
 			}
 
 			if (test_flags & POST_PREREL)
@@ -236,10 +240,14 @@ static int post_run_single (struct post_test *test,
 		if (test_flags & POST_PREREL) {
 			if ((*test->test) (flags) == 0)
 				post_log_mark_succ ( test->testid );
+			else if (test_flags & POST_CRITICAL)
+				gd->flags |= GD_FLG_POSTFAIL;
 		} else {
 		if ((*test->test) (flags) != 0) {
 			post_log ("FAILED\n");
 			show_boot_progress (-32);
+			if (test_flags & POST_CRITICAL)
+				gd->flags |= GD_FLG_POSTFAIL;
 		}
 		else
 			post_log ("PASSED\n");
@@ -266,6 +274,10 @@ int post_run (char *name, int flags)
 		unsigned int last;
 
 		if (post_bootmode_get (&last) & POST_POWERTEST) {
+			if (last & POST_FAIL_SAVE) {
+				last &= ~POST_FAIL_SAVE;
+				gd->flags |= GD_FLG_POSTFAIL;
+			}
 			if (last < post_list_size &&
 				(flags & test_flags[last] & POST_ALWAYS) &&
 				(flags & test_flags[last] & POST_MEM)) {
Signature · 1 line
1.5.4.2
#3 lore raw

PATCH 1/1 Some fixes to dspic, fpga, and gdc post tests for lwmon5.

From: Yuri Tikhonov <[email protected]>

---
 post/board/lwmon5/dspic.c |    2 +-
 post/board/lwmon5/fpga.c  |    4 ++++
 post/board/lwmon5/gdc.c   |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)
post/board/lwmon5/dspic.c +1 -1
index e8fed89..f1c9c15 100644
@@ -94,9 +94,9 @@ int dspic_post_test(int flags)
 	}
 
 	data = dspic_read(DSPIC_SYS_ERROR_REG);
-	if (data != 0) ret = 1;
 	if (data == -1) {
 		post_log("dsPIC : failed read system error\n");
+		ret = 1;
 	} else {
 		post_log("dsPIC SYS-ERROR code: 0x%04X\n", data);
 	}
post/board/lwmon5/fpga.c +4 -0
index 4e3f1d5..b87fc52 100644
@@ -39,6 +39,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define FPGA_VERSION_REG	0xC4000040
 #define FPGA_RAM_START		0xC4200000
 #define FPGA_RAM_END		0xC4203FFF
+#define FPGA_STAT		0xC400000C
 
 #define FPGA_PWM_CTRL_REG	0xC4000020
 #define FPGA_PWM_TV_REG		0xC4000024
@@ -93,6 +94,9 @@ int fpga_post_test(int flags)
 	post_log("FPGA : version %u.%u\n",
 		(version >> 8) & 0xFF, version & 0xFF);
 
+	/* Enable write to FPGA RAM */
+	out_be32((void *)FPGA_STAT, in_be32((void *)FPGA_STAT) | 0x1000);
+
 	read_value = get_ram_size((void *)CFG_FPGA_BASE_1, 0x4000);
 	post_log("FPGA RAM size: %d bytes\n", read_value);
 
post/board/lwmon5/gdc.c +1 -1
index 76e5dd6..0e4f0fd 100644
@@ -35,7 +35,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GDC_SCRATCH_REG 0xC1FF8044
+#define GDC_SCRATCH_REG 0xC1FF8008
 #define GDC_VERSION_REG 0xC1FF8084
 #define GDC_RAM_START   0xC0000000
 #define GDC_RAM_END     0xC2000000
Signature · 1 line
1.5.4.2
#4 lore raw

PATCH 1/1 Add support for the lwmon5 board reset via GPIO58.

From: Yuri Tikhonov <[email protected]>

---
 board/lwmon5/lwmon5.c    |    5 +++++
 include/configs/lwmon5.h |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
board/lwmon5/lwmon5.c +5 -0
index 73d5de5..7c5f6cc 100644
@@ -594,3 +594,8 @@ void video_get_info_str (int line_number, char *info)
 }
 #endif
 #endif /* CONFIG_VIDEO */
+
+void board_reset(void)
+{
+	gpio_write_bit(CFG_GPIO_BOARD_RESET, 1);
+}
include/configs/lwmon5.h +2 -0
index 6489e0e..e179e4f 100644
@@ -36,6 +36,7 @@
 #define CONFIG_BOARD_EARLY_INIT_F 1	/* Call board_early_init_f	*/
 #define CONFIG_BOARD_POSTCLK_INIT 1	/* Call board_postclk_init	*/
 #define CONFIG_MISC_INIT_R	1	/* Call misc_init_r		*/
+#define CONFIG_BOARD_RESET	1	/* Call board_reset		*/
 
 /*-----------------------------------------------------------------------
  * Base addresses -- Note these are effective addresses where the
@@ -516,6 +517,7 @@
 #define CFG_GPIO_EEPROM_EXT_WP	55
 #define CFG_GPIO_HIGHSIDE	56
 #define CFG_GPIO_EEPROM_INT_WP	57
+#define CFG_GPIO_BOARD_RESET	58
 #define CFG_GPIO_LIME_S		59
 #define CFG_GPIO_LIME_RST	60
 #define CFG_GPIO_SYSMON_STATUS	62
Signature · 1 line
1.5.4.2
#5 lore raw

PATCH 1/1 The patch introduces the alternative configuration of the log buffer for

From: Yuri Tikhonov <[email protected]>

To enable this, alternative, configuration the U-Boot board configuration
file for lwmon5 includes the definitions of alternative addresses for header (CONFIG_ALT_LH_ADDR) and buffer (CONFIG_ALT_LB_ADDR).

The Linux shall be configured with the CONFIG_ALT_LB_LOCATION option set,
and has the BOARD_ALT_LH_ADDR and BOARD_ALT_LB_ADDR constants defined in the lwmon5 board-specific header (arch/ppc/platforms/4xx/lwmon5.h).

---
 common/cmd_bootm.c       |    4 ++++
 common/cmd_log.c         |   38 ++++++++++++++++++++++++++++++++------
 include/configs/lwmon5.h |    2 ++
 include/ppc440.h         |    2 ++
 lib_ppc/board.c          |    4 ++++
 5 files changed, 44 insertions(+), 6 deletions(-)
common/cmd_bootm.c +4 -0
index 9546729..9deb781 100644
@@ -545,11 +545,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	}
 
 #ifdef CONFIG_LOGBUFFER
+#ifndef CONFIG_ALT_LB_ADDR
 	kbd=gd->bd;
 	/* Prevent initrd from overwriting logbuffer */
 	if (initrd_high < (kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD))
 		initrd_high = kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD;
 	debug ("## Logbuffer at 0x%08lX ", kbd->bi_memsize-LOGBUFF_LEN);
+#else
+	debug ("## Logbuffer at 0x%08lX ", CONFIG_ALT_LB_ADDR);
+#endif
 #endif
 
 	/*
common/cmd_log.c +32 -6
index e593dbe..34b36ff 100644
@@ -59,14 +59,25 @@ static char buf[1024];
 static unsigned console_loglevel = 3;
 static unsigned default_message_loglevel = 4;
 static unsigned log_version = 1;
+#ifdef CONFIG_ALT_LB_ADDR
+static volatile logbuff_t *log;
+#else
 static logbuff_t *log;
+#endif
+static char *lbuf;
 
 void logbuff_init_ptrs (void)
 {
 	unsigned long tag, post_word;
 	char *s;
 
+#ifdef CONFIG_ALT_LB_ADDR
+	log = (logbuff_t *)CONFIG_ALT_LH_ADDR;
+	lbuf = (char *)CONFIG_ALT_LB_ADDR;
+#else
 	log = (logbuff_t *)(gd->bd->bi_memsize-LOGBUFF_LEN) - 1;
+	lbuf = log->buf;
+#endif
 
 	/* Set up log version */
 	if ((s = getenv ("logversion")) != NULL)
@@ -101,11 +112,26 @@ void logbuff_init_ptrs (void)
 
 void logbuff_reset (void)
 {
+#ifndef CONFIG_ALT_LB_ADDR
 	memset (log, 0, sizeof (logbuff_t));
-	if (log_version == 2)
+#endif
+	if (log_version == 2) {
 		log->v2.tag = LOGBUFF_MAGIC;
-	else
+#ifdef CONFIG_ALT_LB_ADDR
+		log->v2.start = 0;
+		log->v2.con = 0;
+		log->v2.end = 0;
+		log->v2.chars = 0;
+#endif
+	} else {
 		log->v1.tag = LOGBUFF_MAGIC;
+#ifdef CONFIG_ALT_LB_ADDR
+		log->v1.dummy = 0;
+		log->v1.start = 0;
+		log->v1.size = 0;
+		log->v1.chars = 0;
+#endif
+	}
 }
 
 int drv_logbuff_init (void)
@@ -188,7 +214,7 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 				size = log->v1.size;
 			}
 			for (i=0; i < (size&LOGBUFF_MASK); i++) {
-				s = (char *)log->buf+((start+i)&LOGBUFF_MASK);
+				s = lbuf+((start+i)&LOGBUFF_MASK);
 				putc (*s);
 			}
 			return 0;
@@ -196,7 +222,7 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			logbuff_reset ();
 			return 0;
 		} else if (strcmp(argv[1],"info") == 0) {
-			printf ("Logbuffer   at  %08lx\n", (unsigned long)log->buf);
+			printf ("Logbuffer   at  %08lx\n", (unsigned long)lbuf);
 			if (log_version == 2) {
 				printf ("log_start    =  %08lx\n", log->v2.start);
 				printf ("log_end      =  %08lx\n", log->v2.end);
@@ -257,14 +283,14 @@ static int logbuff_printk(const char *line)
 		line_feed = 0;
 		for (; p < buf_end; p++) {
 			if (log_version == 2) {
-				log->buf[log->v2.end & LOGBUFF_MASK] = *p;
+				lbuf[log->v2.end & LOGBUFF_MASK] = *p;
 				log->v2.end++;
 				if (log->v2.end - log->v2.start > LOGBUFF_LEN)
 					log->v2.start++;
 				log->v2.chars++;
 			}
 			else {
-				log->buf[(log->v1.start + log->v1.size) &
+				lbuf[(log->v1.start + log->v1.size) &
 					 LOGBUFF_MASK] = *p;
 				if (log->v1.size < LOGBUFF_LEN)
 					log->v1.size++;
include/configs/lwmon5.h +2 -0
index e179e4f..ced7ba6 100644
@@ -244,6 +244,8 @@
 
 #define CFG_POST_CACHE_ADDR	0x7fff0000 /* free virtual address	*/
 #define CONFIG_LOGBUFFER
+#define CONFIG_ALT_LH_ADDR	(CFG_PERIPHERAL_BASE + GPT0_COMP1)
+#define CONFIG_ALT_LB_ADDR	(CFG_OCM_BASE)
 #define CFG_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
 
 /*-----------------------------------------------------------------------
include/ppc440.h +2 -0
index 6e3b68d..10517cb 100644
@@ -1434,6 +1434,8 @@
 #define GPT0_COMP5			0x00000094
 #define GPT0_COMP4			0x00000090
 #define GPT0_COMP3			0x0000008C
+#define GPT0_COMP2			0x00000088
+#define GPT0_COMP1			0x00000084
 
 #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define SDR0_USB2D0CR                 0x0320
lib_ppc/board.c +4 -0
index fbf1c5d..ee0213e 100644
@@ -436,10 +436,12 @@ void board_init_f (ulong bootflag)
 	addr = CFG_SDRAM_BASE + get_effective_memsize();
 
 #ifdef CONFIG_LOGBUFFER
+#ifndef CONFIG_ALT_LB_ADDR
 	/* reserve kernel log buffer */
 	addr -= (LOGBUFF_RESERVE);
 	debug ("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, addr);
 #endif
+#endif
 
 #ifdef CONFIG_PRAM
 	/*
@@ -1126,9 +1128,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 		pram=0;
 #endif
 #ifdef CONFIG_LOGBUFFER
+#ifndef CONFIG_ALT_LB_ADDR
 		/* Also take the logbuffer into account (pram is in kB) */
 		pram += (LOGBUFF_LEN+LOGBUFF_OVERHEAD)/1024;
 #endif
+#endif
 		sprintf ((char *)memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
 		setenv ("mem", (char *)memsz);
 	}
Signature · 1 line
1.5.4.2
#6 lore raw

PATCH 1/1 Fix backlight in the lwmon5 POST.

From: Yuri Tikhonov <[email protected]>

Backlight was switcehd on even when temperature was too low.

---
 board/lwmon5/lwmon5.c      |   24 +++++++++++++++++++++---
 post/board/lwmon5/fpga.c   |   10 ----------
 post/board/lwmon5/sysmon.c |   33 ++++++++-------------------------
 3 files changed, 29 insertions(+), 38 deletions(-)
board/lwmon5/lwmon5.c +21 -3
index 7c5f6cc..e5fa259 100644
@@ -567,11 +567,13 @@ unsigned int board_video_init (void)
 	return CFG_LIME_BASE_0;
 }
 
-void board_backlight_switch (int flag)
+#define DEFAULT_BRIGHTNESS 0x64
+
+static void board_backlight_brightness(int brightness)
 {
-	if (flag) {
+	if (brightness > 0) {
 		/* pwm duty, lamp on */
-		out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000024), 0x64);
+		out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000024), brightness);
 		out_be32((void *)(CFG_FPGA_BASE_0 + 0x00000020), 0x701);
 	} else {
 		/* lamp off */
@@ -580,6 +582,22 @@ void board_backlight_switch (int flag)
 	}
 }
 
+void board_backlight_switch (int flag)
+{
+	char * param;
+	int rc;
+
+	if (flag) {
+		param = getenv("brightness");
+		rc = param ? simple_strtol(param, NULL, 10) : -1;
+		if (rc < 0)
+			rc = DEFAULT_BRIGHTNESS;
+	} else {
+		rc = 0;
+	}
+	board_backlight_brightness(rc);
+}
+
 #if defined(CONFIG_CONSOLE_EXTRA_INFO)
 /*
  * Return text to be printed besides the logo.
post/board/lwmon5/fpga.c +0 -10
index b87fc52..162174c 100644
@@ -41,16 +41,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define FPGA_RAM_END		0xC4203FFF
 #define FPGA_STAT		0xC400000C
 
-#define FPGA_PWM_CTRL_REG	0xC4000020
-#define FPGA_PWM_TV_REG		0xC4000024
-
-/* Turn on backlight, set brightness */
-void fpga_backlight_enable(int pwm)
-{
-	out_be16((void *)FPGA_PWM_CTRL_REG, 0x0701);
-	out_be16((void *)FPGA_PWM_TV_REG, pwm);
-}
-
 #if CONFIG_POST & CFG_POST_BSPEC3
 
 static int one_scratch_test(uint value)
post/board/lwmon5/sysmon.c +8 -25
index 0eae4c1..f7e51a3 100644
@@ -49,18 +49,16 @@
 #include <watchdog.h>
 #include <i2c.h>
 
+#if defined(CONFIG_VIDEO)
+#include <mb862xx.h>
+#endif
+
 #if CONFIG_POST & CFG_POST_SYSMON
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define DEFAULT_BRIGHTNESS 50
-
 /* from dspic.c */
 extern int dspic_read(ushort reg);
-/* from fpga.c */
-extern void fpga_backlight_enable(int v);
-
-static int sysmon_temp_invalid;
 
 #define	RELOC(x) if (x != NULL) x = (void *) ((ulong) (x) + gd->reloc_off)
 
@@ -70,7 +68,6 @@ typedef struct sysmon_table_s sysmon_table_t;
 static void sysmon_dspic_init (sysmon_t * this);
 static int sysmon_dspic_read (sysmon_t * this, uint addr);
 static void sysmon_backlight_disable (sysmon_table_t * this);
-static void sysmon_backlight_enable (sysmon_table_t * this);
 
 struct sysmon_s
 {
@@ -120,7 +117,7 @@ static sysmon_table_t sysmon_table[] =
      100, 1000, -0x8000, 0x7FFF, 0xFFFF, 0x8000+4750, 0x8000+5250, 0,
                                          0x8000+4750, 0x8000+5250, 0, 0x12CA},
 
-    {"+ 5 V standby", "V", &sysmon_dspic, NULL, sysmon_backlight_enable,
+    {"+ 5 V standby", "V", &sysmon_dspic, NULL, NULL,
      100, 1000, -0x8000, 0x7FFF, 0xFFFF, 0x8000+4750, 0x8000+5250, 0,
                                          0x8000+4750, 0x8000+5250, 0, 0x12C6},
 };
@@ -205,23 +202,9 @@ static int sysmon_dspic_read (sysmon_t * this, uint addr)
 
 static void sysmon_backlight_disable (sysmon_table_t * this)
 {
-	if (!this->val_valid_alt)
-		sysmon_temp_invalid = 1;
-}
-
-static void sysmon_backlight_enable (sysmon_table_t * this)
-{
-	char * param;
-	int rc;
-
-	if (!sysmon_temp_invalid) {
-		param = getenv("brightness");
-		rc = param ? simple_strtol(param, NULL, 10) : -1;
-		if (rc >= 0)
-			fpga_backlight_enable(rc);
-		else
-			fpga_backlight_enable(DEFAULT_BRIGHTNESS);
-	}
+#if defined(CONFIG_VIDEO)
+	board_backlight_switch(this->val_valid_alt);
+#endif
 }
 
 int sysmon_post_test (int flags)
Signature · 1 line
1.5.4.2
#7 lore raw

PATCH 1/1 lwmon5: Fix register test logic to match the specific GDC h/w.

From: Yuri Tikhonov <[email protected]>

---
 post/board/lwmon5/gdc.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
post/board/lwmon5/gdc.c +12 -6
index 0e4f0fd..aa1eee0 100644
@@ -35,7 +35,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GDC_SCRATCH_REG 0xC1FF8008
+#define GDC_SCRATCH_REG 0xC1FF8044
 #define GDC_VERSION_REG 0xC1FF8084
 #define GDC_RAM_START   0xC0000000
 #define GDC_RAM_END     0xC2000000
@@ -44,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int gdc_test_reg_one(uint value)
 {
-	int ret = 0;
+	int ret;
 	uint read_value;
 
 	/* write test pattern */
@@ -56,10 +56,9 @@ static int gdc_test_reg_one(uint value)
 	if (read_value != value) {
 		post_log("GDC SCRATCH test failed write %08X, read %08X\n",
 			value, read_value);
-		ret = 1;
 	}
 
-	return ret;
+	return (read_value != value);
 }
 
 /* Verify GDC, get memory size */
@@ -71,9 +70,16 @@ int gdc_post_test(int flags)
 	post_log("\n");
 	old_value = in_be32((void *)GDC_SCRATCH_REG);
 
-	if (gdc_test_reg_one(0x55555555))
+	/*
+	 * GPIOC2 register behaviour: the LIME graphics processor has a
+	 * maximum of 5 GPIO ports that can be used in this hardware
+	 * configuration. Thus only the  bits  for these 5 GPIOs can be
+	 * activated in the GPIOC2 register. All other bits will always be
+	 * read as zero.
+	 */
+	if (gdc_test_reg_one(0x00150015))
 		ret = 1;
-	if (gdc_test_reg_one(0xAAAAAAAA))
+	if (gdc_test_reg_one(0x000A000A))
 		ret = 1;
 
 	out_be32((void *)GDC_SCRATCH_REG, old_value);
Signature · 1 line
1.5.4.2
#8 lore raw

PATCH 1/1 POST: preparations for moving CONFIG_POST to Makefiles

From: Yuri Tikhonov <[email protected]>

Remove CONFIG_POST ifdefs from the post/ source files.

---
 post/board/lwmon/sysmon.c                 |    3 ---
 post/board/lwmon5/dsp.c                   |    5 -----
 post/board/lwmon5/dspic.c                 |    4 ----
 post/board/lwmon5/fpga.c                  |    4 ----
 post/board/lwmon5/gdc.c                   |    4 ----
 post/board/lwmon5/sysmon.c                |    3 ---
 post/board/lwmon5/watchdog.c              |    4 ----
 post/board/netta/codec.c                  |    3 ---
 post/board/netta/dsp.c                    |    3 ---
 post/cpu/mpc8xx/cache.c                   |    3 ---
 post/cpu/mpc8xx/cache_8xx.S               |    2 --
 post/cpu/mpc8xx/ether.c                   |    4 ----
 post/cpu/mpc8xx/spr.c                     |    3 ---
 post/cpu/mpc8xx/uart.c                    |    4 ----
 post/cpu/mpc8xx/usb.c                     |    4 ----
 post/cpu/mpc8xx/watchdog.c                |    3 ---
 post/cpu/ppc4xx/cache.c                   |    3 ---
 post/cpu/ppc4xx/cache_4xx.S               |    3 ---
 post/cpu/ppc4xx/denali_ecc.c              |    4 ++--
 post/cpu/ppc4xx/ether.c                   |    3 ---
 post/cpu/ppc4xx/fpu.c                     |    2 --
 post/cpu/ppc4xx/spr.c                     |    3 ---
 post/cpu/ppc4xx/uart.c                    |    3 ---
 post/cpu/ppc4xx/watchdog.c                |    3 ---
 post/drivers/i2c.c                        |    3 ---
 post/drivers/memory.c                     |    3 ---
 post/drivers/rtc.c                        |    3 ---
 post/lib_ppc/andi.c                       |    3 ---
 post/lib_ppc/asm.S                        |    3 ---
 post/lib_ppc/b.c                          |    3 ---
 post/lib_ppc/cmp.c                        |    3 ---
 post/lib_ppc/cmpi.c                       |    3 ---
 post/lib_ppc/complex.c                    |    3 ---
 post/lib_ppc/cpu.c                        |    3 ---
 post/lib_ppc/cr.c                         |    3 ---
 post/lib_ppc/fpu/20001122-1.c             |    3 ---
 post/lib_ppc/fpu/20010114-2.c             |    3 ---
 post/lib_ppc/fpu/20010226-1.c             |    3 ---
 post/lib_ppc/fpu/980619-1.c               |    3 ---
 post/lib_ppc/fpu/acc1.c                   |    3 ---
 post/lib_ppc/fpu/compare-fp-1.c           |    3 ---
 post/lib_ppc/fpu/fpu.c                    |    3 ---
 post/lib_ppc/fpu/mul-subnormal-single-1.c |    3 ---
 post/lib_ppc/load.c                       |    3 ---
 post/lib_ppc/multi.c                      |    3 ---
 post/lib_ppc/rlwimi.c                     |    3 ---
 post/lib_ppc/rlwinm.c                     |    3 ---
 post/lib_ppc/rlwnm.c                      |    3 ---
 post/lib_ppc/srawi.c                      |    3 ---
 post/lib_ppc/store.c                      |    3 ---
 post/lib_ppc/string.c                     |    3 ---
 post/lib_ppc/three.c                      |    3 ---
 post/lib_ppc/threei.c                     |    3 ---
 post/lib_ppc/threex.c                     |    3 ---
 post/lib_ppc/two.c                        |    3 ---
 post/lib_ppc/twox.c                       |    3 ---
 post/post.c                               |    4 ----
 post/tests.c                              |    4 ----
 58 files changed, 2 insertions(+), 182 deletions(-)
post/board/lwmon/sysmon.c +0 -3
index f61d598..ea8b5a9 100644
@@ -24,8 +24,6 @@
 #include <post.h>
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /*
  * SYSMON test
  *
@@ -328,4 +326,3 @@ int sysmon_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_SYSMON */
-#endif /* CONFIG_POST */
post/board/lwmon5/dsp.c +0 -5
index 7b53af9..a96ac7d 100644
@@ -24,11 +24,8 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
-
 #if CONFIG_POST & CFG_POST_DSP
 #include <asm/io.h>
 
@@ -54,5 +51,3 @@ int dsp_post_test(int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_DSP */
-#endif /* CONFIG_POST */
-
post/board/lwmon5/dspic.c +0 -4
index f1c9c15..eb1c31c 100644
@@ -24,8 +24,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /* There are two tests for dsPIC currently implemented:
  * 1. dsPIC ready test. Done in board_early_init_f(). Only result verified here.
  * 2. dsPIC POST result test.  This test gets dsPIC POST codes and version.
@@ -105,5 +103,3 @@ int dspic_post_test(int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_BSPEC2 */
-#endif /* CONFIG_POST */
-
post/board/lwmon5/fpga.c +0 -4
index 162174c..b48390b 100644
@@ -23,8 +23,6 @@
  */
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /* This test performs testing of FPGA SCRATCH register,
  * gets FPGA version and run get_ram_size() on FPGA memory
  */
@@ -94,5 +92,3 @@ int fpga_post_test(int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_BSPEC3 */
-#endif /* CONFIG_POST */
-
post/board/lwmon5/gdc.c +0 -4
index aa1eee0..bc16685 100644
@@ -23,8 +23,6 @@
  */
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /* This test attempts to verify board GDC. A scratch register tested, then
  * simple memory test (get_ram_size()) run over GDC memory.
  */
@@ -96,5 +94,3 @@ int gdc_post_test(int flags)
 	return ret;
 }
 #endif /* CONFIG_POST & CFG_POST_BSPEC4 */
-#endif /* CONFIG_POST */
-
post/board/lwmon5/sysmon.c +0 -3
index f7e51a3..15661e3 100644
@@ -25,8 +25,6 @@
 #include <post.h>
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /*
  * SYSMON test
  *
@@ -245,4 +243,3 @@ int sysmon_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_SYSMON */
-#endif /* CONFIG_POST */
post/board/lwmon5/watchdog.c +0 -4
index ad9e6f3..699266b 100644
@@ -29,8 +29,6 @@
  * trigger watchdog reset.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_WATCHDOG
@@ -128,5 +126,3 @@ int lwmon5_watchdog_post_test(int flags)
 
 
 #endif /* CONFIG_POST & CFG_POST_WATCHDOG */
-#endif /* CONFIG_POST */
-
post/board/netta/codec.c +0 -3
index e881752..115e331 100644
@@ -31,8 +31,6 @@
  * in the board specific function.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_CODEC
@@ -45,4 +43,3 @@ int codec_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_CODEC */
-#endif /* CONFIG_POST */
post/board/netta/dsp.c +0 -3
index 63531a2..dcef4e8 100644
@@ -31,8 +31,6 @@
  * in the board specific function.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_DSP
@@ -45,4 +43,3 @@ int dsp_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_DSP */
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/cache.c +0 -3
index 501465c..36965a1 100644
@@ -29,8 +29,6 @@
  * several test scenarios.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <watchdog.h>
 
@@ -78,4 +76,3 @@ int cache_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_CACHE */
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/cache_8xx.S +0 -2
index 2d41b55..a3fc39b 100644
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_POST
 #if defined(CONFIG_MPC823) || \
     defined(CONFIG_MPC850) || \
     defined(CONFIG_MPC855) || \
@@ -492,4 +491,3 @@ cache_post_test6_data:
 
 #endif /* CONFIG_MPC823 || MPC850 || MPC855 || MPC860 */
 #endif /* CONFIG_POST & CFG_POST_CACHE */
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/ether.c +0 -4
index 8c87b59..2fa5cf4 100644
@@ -35,8 +35,6 @@
  *   TEST_NUM - number of tests
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #if CONFIG_POST & CFG_POST_ETHER
 #if defined(CONFIG_8xx)
@@ -627,5 +625,3 @@ int ether_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_ETHER */
-
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/spr.c +0 -3
index 330b977..83f04da 100644
@@ -33,8 +33,6 @@
  * corresponding table value.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_SPR
@@ -149,4 +147,3 @@ int spr_post_test (int flags)
 	return ret;
 }
 #endif /* CONFIG_POST & CFG_POST_SPR */
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/uart.c +0 -4
index fd97e38..635debe 100644
@@ -36,8 +36,6 @@
  *   TEST_NUM - number of tests
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #if CONFIG_POST & CFG_POST_UART
 #if defined(CONFIG_8xx)
@@ -556,5 +554,3 @@ int uart_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_UART */
-
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/usb.c +0 -4
index 0c74cfa..5877981 100644
@@ -34,8 +34,6 @@
  * Initialization Example.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_USB
@@ -265,5 +263,3 @@ int usb_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_USB */
-
-#endif /* CONFIG_POST */
post/cpu/mpc8xx/watchdog.c +0 -3
index 48c4282..f94158a 100644
@@ -33,8 +33,6 @@
  * reboots, on the second iteration the test routine reports a success.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <watchdog.h>
 
@@ -75,4 +73,3 @@ int watchdog_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_WATCHDOG */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/cache.c +0 -3
index 466ca92..be6a2bf 100644
@@ -31,8 +31,6 @@
  * several test scenarios.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_CACHE
@@ -122,4 +120,3 @@ int cache_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_CACHE */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/cache_4xx.S +0 -3
index d5cb075..455ffa0 100644
@@ -25,8 +25,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <ppc_asm.tmpl>
 #include <ppc_defs.h>
@@ -489,4 +487,3 @@ cache_post_test_inst:
 	blr
 
 #endif /* CONFIG_POST & CFG_POST_CACHE */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/denali_ecc.c +2 -2
index 439f80d..12a1bbf 100644
@@ -31,7 +31,7 @@
 #include <common.h>
 #include <watchdog.h>
 
-#if defined(CONFIG_POST) && (defined(CONFIG_440EPX) || defined(CONFIG_440GRX))
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 
 #include <post.h>
 
@@ -268,4 +268,4 @@ int ecc_post_test(int flags)
 	return ret;
 }
 #endif /* CONFIG_POST & CFG_POST_ECC */
-#endif /* defined(CONFIG_POST) && ... */
+#endif /* defined(CONFIG_440EPX) || defined(CONFIG_440GRX) */
post/cpu/ppc4xx/ether.c +0 -3
index 4ac7491..ccbfcf9 100644
@@ -37,8 +37,6 @@
  *   TEST_NUM - number of tests
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_ETHER
@@ -430,4 +428,3 @@ out_free:
 }
 
 #endif /* CONFIG_POST & CFG_POST_ETHER */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/fpu.c +0 -2
index 0c26fe0..fff4169 100644
@@ -25,7 +25,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_POST
 #if defined(CONFIG_440EP) || \
     defined(CONFIG_440EPX)
 
@@ -56,4 +55,3 @@ void fpu_enable(void)
 }
 
 #endif
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/spr.c +0 -3
index 37c9559..6152eb2 100644
@@ -35,8 +35,6 @@
  * corresponding table value.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_SPR
@@ -199,4 +197,3 @@ int spr_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_SPR */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/uart.c +0 -3
index f47b48e..27cfb91 100644
@@ -32,8 +32,6 @@
  * characters are transmitted.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_UART
@@ -389,4 +387,3 @@ int uart_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_UART */
-#endif /* CONFIG_POST */
post/cpu/ppc4xx/watchdog.c +0 -3
index bd4f4c9..7fdecb4 100644
@@ -35,8 +35,6 @@
  * reboots, on the second iteration the test routine reports a success.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_WATCHDOG
@@ -68,4 +66,3 @@ int watchdog_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_WATCHDOG */
-#endif /* CONFIG_POST */
post/drivers/i2c.c +0 -3
index 1b2e644..f54fe99 100644
@@ -23,8 +23,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 /*
  * I2C test
  *
@@ -91,4 +89,3 @@ int i2c_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_I2C */
-#endif /* CONFIG_POST */
post/drivers/memory.c +0 -3
index fb96985..e94d92c 100644
@@ -150,8 +150,6 @@
  * the whole RAM.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <watchdog.h>
 
@@ -483,4 +481,3 @@ int memory_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_MEMORY */
-#endif /* CONFIG_POST */
post/drivers/rtc.c +0 -3
index 7d4f9b8..4afe8e6 100644
@@ -38,8 +38,6 @@
  *      nonleap-years.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <rtc.h>
 
@@ -180,4 +178,3 @@ int rtc_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_RTC */
-#endif /* CONFIG_POST */
post/lib_ppc/andi.c +0 -3
index 7ddf2ab..e3315bf 100644
@@ -32,8 +32,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -120,4 +118,3 @@ int cpu_post_test_andi (void)
 }
 
 #endif
-#endif
post/lib_ppc/asm.S +0 -3
index 1279176..6220ed2 100644
@@ -22,8 +22,6 @@
 
 #include <config.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include <ppc_asm.tmpl>
 #include <ppc_defs.h>
@@ -358,4 +356,3 @@ cpu_post_complex_2_loop:
 blr
 
 #endif
-#endif
post/lib_ppc/b.c +0 -3
index 6e276c4..45b9ff2 100644
@@ -37,8 +37,6 @@
  * linked in U-Boot at build time.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -194,4 +192,3 @@ int cpu_post_test_b (void)
 }
 
 #endif
-#endif
post/lib_ppc/cmp.c +0 -3
index 789a24c..89f754a 100644
@@ -36,8 +36,6 @@
  * the result in and the expected result.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -130,4 +128,3 @@ int cpu_post_test_cmp (void)
 }
 
 #endif
-#endif
post/lib_ppc/cmpi.c +0 -3
index e0c2aaf..0afdd71 100644
@@ -36,8 +36,6 @@
  * the result in and the expected result.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -130,4 +128,3 @@ int cpu_post_test_cmpi (void)
 }
 
 #endif
-#endif
post/lib_ppc/complex.c +0 -3
index 033584b..271392a 100644
@@ -31,8 +31,6 @@
  * calculations, but probably under different timing conditions, etc.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -123,4 +121,3 @@ int cpu_post_test_complex (void)
 }
 
 #endif
-#endif
post/lib_ppc/cpu.c +0 -3
index 4ab6d2d..5c7f761 100644
@@ -32,8 +32,6 @@
  * For more details refer to post/cpu/ *.c files.
  */
 
-#ifdef CONFIG_POST
-
 #include <watchdog.h>
 #include <post.h>
 #include <asm/mmu.h>
@@ -147,4 +145,3 @@ int cpu_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_CPU */
-#endif /* CONFIG_POST */
post/lib_ppc/cr.c +0 -3
index da6ef37..0bd9e74 100644
@@ -46,8 +46,6 @@
  * expected one.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -353,4 +351,3 @@ int cpu_post_test_cr (void)
 }
 
 #endif
-#endif
post/lib_ppc/fpu/20001122-1.c +0 -3
index f689b82..dece614 100644
@@ -26,8 +26,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -59,4 +57,3 @@ int fpu_post_test_math1 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/20010114-2.c +0 -3
index 6e60507..8a17217 100644
@@ -26,8 +26,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -63,4 +61,3 @@ int fpu_post_test_math2 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/20010226-1.c +0 -3
index b2c47e3..f366252 100644
@@ -26,8 +26,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -51,4 +49,3 @@ int fpu_post_test_math3 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/980619-1.c +0 -3
index 990aa0c..7f26482 100644
@@ -26,8 +26,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -57,4 +55,3 @@ int fpu_post_test_math4 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/acc1.c +0 -3
index 4cecbf6..921282e 100644
@@ -26,8 +26,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -54,4 +52,3 @@ int fpu_post_test_math5 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/compare-fp-1.c +0 -3
index d866ad5..be8f620 100644
@@ -28,8 +28,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -222,4 +220,3 @@ int fpu_post_test_math6 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/fpu.c +0 -3
index 07dcba8..9ddb67a 100644
@@ -34,8 +34,6 @@
  * For more details refer to post/cpu/ *.c files.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -89,4 +87,3 @@ int fpu_post_test (int flags)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/fpu/mul-subnormal-single-1.c +0 -3
index 67f48da..7e6fe87 100644
@@ -28,8 +28,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 #if CONFIG_POST & CFG_POST_FPU
@@ -100,4 +98,3 @@ int fpu_post_test_math7 (void)
 }
 
 #endif /* CONFIG_POST & CFG_POST_FPU */
-#endif /* CONFIG_POST */
post/lib_ppc/load.c +0 -3
index 393c568..86bc223 100644
@@ -41,8 +41,6 @@
  * register (it must change for "load with update" instructions).
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -252,4 +250,3 @@ int cpu_post_test_load (void)
 }
 
 #endif
-#endif
post/lib_ppc/multi.c +0 -3
index 8724384..5d3f584 100644
@@ -33,8 +33,6 @@
  * of the source and target buffers are then compared.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -78,4 +76,3 @@ int cpu_post_test_multi (void)
 }
 
 #endif
-#endif
post/lib_ppc/rlwimi.c +0 -3
index f65f79a..1d8e61e 100644
@@ -32,8 +32,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -159,4 +157,3 @@ int cpu_post_test_rlwimi (void)
 }
 
 #endif
-#endif
post/lib_ppc/rlwinm.c +0 -3
index e240c41..113e79d 100644
@@ -32,8 +32,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -152,4 +150,3 @@ int cpu_post_test_rlwinm (void)
 }
 
 #endif
-#endif
post/lib_ppc/rlwnm.c +0 -3
index 523cf4d..a6684bf 100644
@@ -32,8 +32,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -162,4 +160,3 @@ int cpu_post_test_rlwnm (void)
 }
 
 #endif
-#endif
post/lib_ppc/srawi.c +0 -3
index 91c82c9..8c70007 100644
@@ -32,8 +32,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -153,4 +151,3 @@ int cpu_post_test_srawi (void)
 }
 
 #endif
-#endif
post/lib_ppc/store.c +0 -3
index f495bf2..09ec485 100644
@@ -41,8 +41,6 @@
  * with update" instructions).
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -232,4 +230,3 @@ int cpu_post_test_store (void)
 }
 
 #endif
-#endif
post/lib_ppc/string.c +0 -3
index bd83bd1..b2daa88 100644
@@ -33,8 +33,6 @@
  * of the source and target buffers are then compared.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -103,4 +101,3 @@ int cpu_post_test_string (void)
 }
 
 #endif
-#endif
post/lib_ppc/three.c +0 -3
index c2d7476..a7f1a86 100644
@@ -35,8 +35,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -256,4 +254,3 @@ int cpu_post_test_three (void)
 }
 
 #endif
-#endif
post/lib_ppc/threei.c +0 -3
index 79f0178..bbb4f50 100644
@@ -34,8 +34,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -134,4 +132,3 @@ int cpu_post_test_threei (void)
 }
 
 #endif
-#endif
post/lib_ppc/threex.c +0 -3
index 2c72063..6aac937 100644
@@ -35,8 +35,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -226,4 +224,3 @@ int cpu_post_test_threex (void)
 }
 
 #endif
-#endif
post/lib_ppc/two.c +0 -3
index cfbac5e..3d6b3c0 100644
@@ -35,8 +35,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -173,4 +171,3 @@ int cpu_post_test_two (void)
 }
 
 #endif
-#endif
post/lib_ppc/twox.c +0 -3
index 48d9954..7417a36 100644
@@ -35,8 +35,6 @@
  * different sets of operand registers and result registers.
  */
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 #include "cpu_asm.h"
 
@@ -173,4 +171,3 @@ int cpu_post_test_twox (void)
 }
 
 #endif
-#endif
post/post.c +0 -4
index 1df0657..c016c3a 100644
@@ -30,8 +30,6 @@
 #include <logbuff.h>
 #endif
 
-#ifdef CONFIG_POST
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #define POST_MAX_NUMBER		32
@@ -442,5 +440,3 @@ unsigned long post_time_ms (unsigned long base)
 	return 0; /* Not implemented yet */
 #endif
 }
-
-#endif /* CONFIG_POST */
post/tests.c +0 -4
index 53d01e3..36473e3 100644
@@ -27,8 +27,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_POST
-
 #include <post.h>
 
 extern int cache_post_test (int flags);
@@ -278,5 +276,3 @@ struct post_test post_list[] =
 };
 
 unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
-
-#endif /* CONFIG_POST */
Signature · 1 line
1.5.4.2
#9 lore raw

PATCH 1/1 POST: move CONFIG_POST to Makefiles

From: Yuri Tikhonov <[email protected]>

Introduce the new logical option CONFIG_HAS_POST which is set when the platform has CONFIG_POST set. Use CONFIG_HAS_POST in the post/ Makefiles to determine should the POST libs be compiled for the selected target platform, or not.

To avoid breaking u-boot linking process, the empty post/libpost.a file is created for platforms which do not have POSTs.

---
 Makefile                   |   10 +--------
 include/common.h           |   11 ++++++++++
 post/Makefile              |   47 ++++++++++++++++++++++++++++++++++++++++---
 post/board/lwmon5/Makefile |    3 +-
 post/cpu/ppc4xx/Makefile   |    5 ++-
 post/drivers/Makefile      |    6 +---
 post/lib_ppc/Makefile      |   11 ++++-----
 post/lib_ppc/fpu/Makefile  |    6 ++--
 post/rules.mk              |    2 +
 9 files changed, 72 insertions(+), 29 deletions(-)
Makefile +1 -9
index 4fde699..b2b59b2 100644
@@ -233,18 +233,10 @@ LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
 LIBS += drivers/usb/libusb.a
 LIBS += drivers/video/libvideo.a
-LIBS += post/libpost.a post/drivers/libpostdrivers.a
-LIBS += $(shell if [ -d post/lib_$(ARCH) ]; then echo \
-	"post/lib_$(ARCH)/libpost$(ARCH).a"; fi)
-LIBS += $(shell if [ -d post/lib_$(ARCH)/fpu ]; then echo \
-	"post/lib_$(ARCH)/fpu/libpost$(ARCH)fpu.a"; fi)
-LIBS += $(shell if [ -d post/cpu/$(CPU) ]; then echo \
-	"post/cpu/$(CPU)/libpost$(CPU).a"; fi)
-LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \
-	"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
 LIBS += common/libcommon.a
 LIBS += libfdt/libfdt.a
 LIBS += api/libapi.a
+LIBS += post/libpost.a
 
 LIBS := $(addprefix $(obj),$(LIBS))
 .PHONY : $(LIBS) $(VERSION_FILE)
include/common.h +11 -0
index 673afdd..8d435b9 100644
@@ -672,4 +672,15 @@ void inline show_boot_progress (int val);
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
+/* Multicore arch functions */
+#ifdef CONFIG_MP
+int cpu_status(int nr);
+int cpu_reset(int nr);
+int cpu_release(int nr, int argc, char *argv[]);
+#endif
+
+#ifdef CONFIG_POST
+#define CONFIG_HAS_POST
+#endif
+
 #endif	/* __COMMON_H_ */
post/Makefile +43 -4

54 lines not on this page · raw message

post/board/lwmon5/Makefile +2 -1
index 5a92d1c..3cb6426 100644
@@ -20,9 +20,10 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
+include $(TOPDIR)/include/autoconf.mk
 
 LIB	= libpostlwmon5.a
 
-COBJS	= sysmon.o watchdog.o dspic.o fpga.o dsp.o gdc.o
+COBJS-$(CONFIG_HAS_POST)	+= sysmon.o watchdog.o dspic.o fpga.o dsp.o gdc.o
 
 include $(TOPDIR)/post/rules.mk
post/cpu/ppc4xx/Makefile +3 -2
index e3f44b7..7b13413 100644
@@ -20,10 +20,11 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+include $(TOPDIR)/include/autoconf.mk
 
 LIB	= libpostppc4xx.a
 
-AOBJS   = cache_4xx.o
-COBJS	= cache.o denali_ecc.o ether.o fpu.o spr.o uart.o watchdog.o
+AOBJS-$(CONFIG_HAS_POST)	+= cache_4xx.o
+COBJS-$(CONFIG_HAS_POST)	+= cache.o denali_ecc.o ether.o fpu.o spr.o uart.o watchdog.o
 
 include $(TOPDIR)/post/rules.mk
post/drivers/Makefile +2 -4
index cb2f1de..0b6cdf5 100644
@@ -20,12 +20,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-
-
-SUBDIRS =
+include $(TOPDIR)/config.mk
 
 LIB	= libpostdrivers.a
 
-COBJS	= i2c.o memory.o rtc.o
+COBJS-$(CONFIG_HAS_POST)	+= i2c.o memory.o rtc.o
 
 include $(TOPDIR)/post/rules.mk
post/lib_ppc/Makefile +5 -6
index 9f1b329..bd7a232 100644
@@ -20,14 +20,13 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-
-SUBDIRS = fpu
+include $(TOPDIR)/config.mk
 
 LIB	= libpostppc.a
 
-AOBJS	= asm.o
-COBJS	= cpu.o cmp.o cmpi.o two.o twox.o three.o threex.o
-COBJS   += threei.o andi.o srawi.o rlwnm.o rlwinm.o rlwimi.o
-COBJS	+= store.o load.o cr.o b.o multi.o string.o complex.o
+AOBJS-$(CONFIG_HAS_POST)	+= asm.o
+COBJS-$(CONFIG_HAS_POST)	+= cpu.o cmp.o cmpi.o two.o twox.o three.o threex.o
+COBJS-$(CONFIG_HAS_POST)   += threei.o andi.o srawi.o rlwnm.o rlwinm.o rlwimi.o
+COBJS-$(CONFIG_HAS_POST)	+= store.o load.o cr.o b.o multi.o string.o complex.o
 
 include $(TOPDIR)/post/rules.mk
post/lib_ppc/fpu/Makefile +3 -3
index 82646c8..db43593 100644
@@ -20,12 +20,12 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-
+include $(TOPDIR)/config.mk
 
 LIB	= libpostppcfpu.a
 
-COBJS	+= fpu.o 20001122-1.o 20010114-2.o 20010226-1.o 980619-1.o
-COBJS	+= acc1.o compare-fp-1.o mul-subnormal-single-1.o
+COBJS-$(CONFIG_HAS_POST)	+= fpu.o 20001122-1.o 20010114-2.o 20010226-1.o 980619-1.o
+COBJS-$(CONFIG_HAS_POST)	+= acc1.o compare-fp-1.o mul-subnormal-single-1.o
 
 include $(TOPDIR)/post/rules.mk
 
post/rules.mk +2 -0
index e2c73c6..94e72be 100644
@@ -23,6 +23,8 @@
 
 include $(TOPDIR)/config.mk
 
+COBJS	:= $(COBJS-y)
+AOBJS	:= $(AOBJS-y)
 SRCS 	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
 LIB	:= $(obj)$(LIB)
Signature · 1 line
1.5.4.2
#10 lore raw

PATCH 1/1 lwmon5 watchdog: limit trigger rate

From: Yuri Tikhonov <[email protected]>

Limit the rate of h/w watch-dog triggering on the LWMON5 board by the CONFIG_WD_MAX_RATE value.

Note that an earlier version of this patch which used microseconds instead of ticks dis not work. The problem was that we used usec2ticks() to convert microseconds into ticks. usec2ticks() uses get_tbclk(), which in turn calls get_sys_info(). It turns out that this function does a lot of prolonged operations (like divisions) which take too much time so we do not trigger the watchdog in time, and it resets the system.

---
 board/lwmon5/lwmon5.c         |   18 ++++++++++++++++++
 include/asm-ppc/global_data.h |    3 +++
 include/configs/lwmon5.h      |    1 +
 3 files changed, 22 insertions(+), 0 deletions(-)
board/lwmon5/lwmon5.c +18 -0
index e5fa259..b63fbdc 100644
@@ -476,6 +476,24 @@ int is_pci_host(struct pci_controller *hose)
 void hw_watchdog_reset(void)
 {
 	int val;
+#if defined(CONFIG_WD_MAX_RATE)
+	unsigned long long ct = get_ticks();
+
+	/*
+	 * Don't allow watch-dog triggering more frequently than
+	 * the predefined value CONFIG_WD_MAX_RATE [ticks].
+	 */
+	if (ct >= gd->wdt_last) {
+		if ((ct - gd->wdt_last) < CONFIG_WD_MAX_RATE)
+			return;
+	} else {
+		/* Time base counter had been reset */
+		if (((unsigned long long)(-1) - gd->wdt_last + ct) <
+		    CONFIG_WD_MAX_RATE)
+			return;
+	}
+	gd->wdt_last = get_ticks();
+#endif
 
 	/*
 	 * Toggle watchdog output
include/asm-ppc/global_data.h +3 -0
index e07092b..4657604 100644
@@ -155,6 +155,9 @@ typedef	struct	global_data {
 #if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
 	unsigned long kbd_status;
 #endif
+#if defined(CONFIG_WD_MAX_RATE)
+	unsigned long long wdt_last;	/* trace watch-dog triggering rate */
+#endif
 	void		**jt;		/* jump table */
 } gd_t;
 
include/configs/lwmon5.h +1 -0
index ced7ba6..58f078b 100644
@@ -455,6 +455,7 @@
 
 #define CONFIG_HW_WATCHDOG	1	/* Use external HW-Watchdog	*/
 #define CONFIG_WD_PERIOD	40000	/* in usec */
+#define CONFIG_WD_MAX_RATE	66600	/* in ticks */
 
 /*
  * For booting Linux, the board info and command line data
Signature · 1 line
1.5.4.2
#11 lore raw

PATCH 1/1 Added watchdog triggering calls in the "mtest" test function.

From: Sergei Poselenov <[email protected]>

---
 common/cmd_mem.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
common/cmd_mem.c +7 -0
index 4262e26..4740664 100644
@@ -35,6 +35,7 @@
 #ifdef CONFIG_HAS_DATAFLASH
 #include <dataflash.h>
 #endif
+#include <watchdog.h>
 
 #if defined(CONFIG_CMD_MEMORY)		\
     || defined(CONFIG_CMD_I2C)		\
@@ -868,6 +869,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		    }
 		}
 		start[test_offset] = pattern;
+		WATCHDOG_RESET();
 
 		/*
 		 * Check for addr bits stuck low or shorted.
@@ -905,6 +907,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		 * Fill memory with a known pattern.
 		 */
 		for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+			WATCHDOG_RESET();
 			start[offset] = pattern;
 		}
 
@@ -912,6 +915,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		 * Check each location and invert it for the second pass.
 		 */
 		for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+		    WATCHDOG_RESET();
 		    temp = start[offset];
 		    if (temp != pattern) {
 			printf ("\nFAILURE (read/write) @ 0x%.8lx:"
@@ -928,6 +932,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		 * Check each location for the inverted pattern and zero it.
 		 */
 		for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+		    WATCHDOG_RESET();
 		    anti_pattern = ~pattern;
 		    temp = start[offset];
 		    if (temp != anti_pattern) {
@@ -954,6 +959,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			pattern, "");
 
 		for (addr=start,val=pattern; addr<end; addr++) {
+			WATCHDOG_RESET();
 			*addr = val;
 			val  += incr;
 		}
@@ -961,6 +967,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		puts ("Reading...");
 
 		for (addr=start,val=pattern; addr<end; addr++) {
+			WATCHDOG_RESET();
 			readback = *addr;
 			if (readback != val) {
 				printf ("\nMem error @ 0x%08X: "
Signature · 1 line
1.5.4.2
#12 lore raw

PATCH 1/1 lwmon5 watchdog: limit trigger rate

In reply to Wolfgang Denk
Quoted 13 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

Limit the rate of h/w watch-dog triggering on the LWMON5 board by the CONFIG_WD_MAX_RATE value.

Note that an earlier version of this patch which used microseconds instead of ticks dis not work. The problem was that we used usec2ticks() to convert microseconds into ticks. usec2ticks() uses get_tbclk(), which in turn calls get_sys_info(). It turns out that this function does a lot of prolonged operations (like divisions) which take too much time so we do not trigger the watchdog in time, and it resets the system.

Quoted 1 line

Applied to u-boot-ppc4xx repository. 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
=====================================================================

#13 lore raw

PATCH 1/1 lwmon5: Fix register test logic to match the specific GDC h/w.

In reply to Wolfgang Denk
Quoted 4 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

Already included in current U-Boot.

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
=====================================================================

#14 lore raw

PATCH 1/1 Fix backlight in the lwmon5 POST.

In reply to Wolfgang Denk
Quoted 6 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

Backlight was switcehd on even when temperature was too low.

Already included in current U-Boot.

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
=====================================================================

#15 lore raw

PATCH 1/1 Add support for the lwmon5 board reset via GPIO58.

In reply to Wolfgang Denk
Quoted 4 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

Already included in current U-Boot.

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
=====================================================================

#16 lore raw

PATCH 1/1 Some fixes to dspic, fpga, and gdc post tests for lwmon5.

In reply to Wolfgang Denk
Quoted 4 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

Already included in current U-Boot.

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
=====================================================================

#17 lore raw

PATCH 1/1 The patch adds new POST tests for the Lwmon5 board.

In reply to Wolfgang Denk
Quoted 10 lines · Wolfgang Denk

From: Yuri Tikhonov <[email protected]>

* External Watchdog test;
* dsPIC tests;
* FPGA test;
* GDC test;
* Sysmon tests.

Already included in current U-Boot.

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
=====================================================================