Skip to contentSkip to conversation

TQM5200S: fix commands for STK52xx base board because of missing SM501 grafic controller

PATCH New Martin Krause 3 participants 3 messages Oct 22, 2007 – Oct 23, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TQM5200S: fix commands for STK52xx base board because of missing SM501 grafic controller

Some commands for the STK52xx base board try to access the SM501 grafic controller. But the TQM5200S has no grafic controller (only the TQM5200 and the TQM5200B have). This patch deactivates the commands accessing the SM501 for the TQM5200S.

---
If I receive no negative comments to this patch, I will pick it to the u-boot-tq-group repository and send a pull request.

Best regards,
Martin

 board/tqm5200/cmd_stk52xx.c |   17 ++++++++++-------
 board/tqm5200/tqm5200.c     |    2 ++
 2 files changed, 12 insertions(+), 7 deletions(-)
board/tqm5200/cmd_stk52xx.c +10 -7
index b746679..27a6c41 100644
@@ -561,7 +561,7 @@ void led_init(void)
 	gpt->gpt6.emsr |=  0x00000024;
 	gpt->gpt7.emsr |=  0x00000024;
 
-
+#ifndef CONFIG_TQM5200S
 	/* enable SM501 GPIO control (in both power modes) */
 	*(vu_long *) (SM501_MMIO_BASE+SM501_POWER_MODE0_GATE) |=
 		POWER_MODE_GATE_GPIO_PWM_I2C;
@@ -574,6 +574,7 @@ void led_init(void)
 
 	/* configure SM501 gpio pins 48-51 as output */
 	*(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_DIR_HIGH) |= (0xF << 16);
+#endif /* !CONFIG_TQM5200S */
 }
 
 /*
@@ -650,7 +651,7 @@ int do_led(char *argv[])
 			gpt->gpt7.emsr &=  ~(1 << 4);
 		}
 		break;
-
+#ifndef CONFIG_TQM5200S
 	case 24:
 		if (strcmp (argv[3], "on") == 0) {
 			*(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_LOW) |=
@@ -730,7 +731,7 @@ int do_led(char *argv[])
 				~(0x1 << 19);
 		}
 		break;
-
+#endif /* !CONFIG_TQM5200S */
 	default:
 		printf ("%s: invalid led number %s\n", __FUNCTION__, argv[2]);
 		return 1;
@@ -1110,7 +1111,7 @@ int do_rs232(char *argv[])
 	return error_status;
 }
 
-#ifndef CONFIG_FO300
+#if !defined(CONFIG_FO300) && !defined(CONFIG_TQM5200S)
 static void sm501_backlight (unsigned int state)
 {
 	if (state == BL_ON) {
@@ -1120,7 +1121,7 @@ static void sm501_backlight (unsigned int state)
 		*(vu_long *)(SM501_MMIO_BASE+SM501_PANEL_DISPLAY_CONTROL) &=
 			~((1 << 26) | (1 << 27));
 }
-#endif
+#endif /* !CONFIG_FO300 & !CONFIG_TQM5200S */
 
 int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -1160,7 +1161,7 @@ int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			else
 				printf ("Error\n");
 			return rcode;
-#ifndef CONFIG_FO300
+#if !defined(CONFIG_FO300) && !defined(CONFIG_TQM5200S)
 		} else if (strncmp (argv[1], "backlight", 4) == 0) {
 			if (strncmp (argv[2], "on", 2) == 0) {
 				sm501_backlight (BL_ON);
@@ -1170,7 +1171,7 @@ int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 				sm501_backlight (BL_OFF);
 				return 0;
 			}
-#endif
+#endif /* !CONFIG_FO300 & !CONFIG_TQM5200S */
 		}
 		break;
 
@@ -1228,8 +1229,10 @@ U_BOOT_CMD(
 	"     - loopback plug for X83 required\n"
 	"fkt rs232 number\n"
 	"     - loopback plug(s) for X2 required\n"
+#ifndef CONFIG_TQM5200S
 	"fkt backlight on/off\n"
 	"     - switch backlight on or off\n"
+#endif /* !CONFIG_TQM5200S */
 );
 #elif defined(CONFIG_FO300)
 U_BOOT_CMD(
board/tqm5200/tqm5200.c +2 -0
index 29d6f00..d10cb59 100644
@@ -543,6 +543,7 @@ int last_stage_init (void)
 		__asm__ volatile ("sync");
 	}
 
+#ifndef CONFIG_TQM5200S	/* The TQM5200S has no SM501 grafic controller */
 	/*
 	 * Check for Grafic Controller
 	 */
@@ -586,6 +587,7 @@ int last_stage_init (void)
 #endif
 
 	return 0;
+#endif /* !CONFIG_TQM5200S */
 }
 
 #ifdef CONFIG_VIDEO_SM501
#1 lore raw

PATCH 1/1 TQM5200S: fix commands for STK52xx base board because of missing SM501 grafic controller

Quoted 6 lines · Martin Krause

Some commands for the STK52xx base board try to access the SM501 grafic controller. But the TQM5200S has no grafic controller (only the TQM5200 and the TQM5200B have). This patch deactivates the commands accessing the SM501 for the TQM5200S.

Quoted 129 lines

---
If I receive no negative comments to this patch, I will pick it to the u-boot-tq-group repository and send a pull request.

Best regards,
Martin

 board/tqm5200/cmd_stk52xx.c |   17 ++++++++++-------
 board/tqm5200/tqm5200.c     |    2 ++
 2 files changed, 12 insertions(+), 7 deletions(-)
board/tqm5200/cmd_stk52xx.c +10 -7
index b746679..27a6c41 100644
@@ -561,7 +561,7 @@ void led_init(void)
        gpt->gpt6.emsr |=  0x00000024;
        gpt->gpt7.emsr |=  0x00000024;
 
-
+#ifndef CONFIG_TQM5200S
        /* enable SM501 GPIO control (in both power modes) */
        *(vu_long *) (SM501_MMIO_BASE+SM501_POWER_MODE0_GATE) |=
                POWER_MODE_GATE_GPIO_PWM_I2C;
@@ -574,6 +574,7 @@ void led_init(void)
 
        /* configure SM501 gpio pins 48-51 as output */
        *(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_DIR_HIGH) |= (0xF << 16);
+#endif /* !CONFIG_TQM5200S */
 }
 
 /*
@@ -650,7 +651,7 @@ int do_led(char *argv[])
                        gpt->gpt7.emsr &=  ~(1 << 4);
                }
                break;
-
+#ifndef CONFIG_TQM5200S
        case 24:
                if (strcmp (argv[3], "on") == 0) {
                        *(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_LOW) |=
@@ -730,7 +731,7 @@ int do_led(char *argv[])
                                ~(0x1 << 19);
                }
                break;
-
+#endif /* !CONFIG_TQM5200S */
        default:
                printf ("%s: invalid led number %s\n", __FUNCTION__, argv[2]);
                return 1;
@@ -1110,7 +1111,7 @@ int do_rs232(char *argv[])
        return error_status;
 }
 
-#ifndef CONFIG_FO300
+#if !defined(CONFIG_FO300) && !defined(CONFIG_TQM5200S)
 static void sm501_backlight (unsigned int state)
 {
        if (state == BL_ON) {
@@ -1120,7 +1121,7 @@ static void sm501_backlight (unsigned int state)
                *(vu_long *)(SM501_MMIO_BASE+SM501_PANEL_DISPLAY_CONTROL) &=
                        ~((1 << 26) | (1 << 27));
 }
-#endif
+#endif /* !CONFIG_FO300 & !CONFIG_TQM5200S */
 
 int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -1160,7 +1161,7 @@ int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        else
                                printf ("Error\n");
                        return rcode;
-#ifndef CONFIG_FO300
+#if !defined(CONFIG_FO300) && !defined(CONFIG_TQM5200S)
                } else if (strncmp (argv[1], "backlight", 4) == 0) {
                        if (strncmp (argv[2], "on", 2) == 0) {
                                sm501_backlight (BL_ON);
@@ -1170,7 +1171,7 @@ int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                sm501_backlight (BL_OFF);
                                return 0;
                        }
-#endif
+#endif /* !CONFIG_FO300 & !CONFIG_TQM5200S */
                }
                break;
 
@@ -1228,8 +1229,10 @@ U_BOOT_CMD(
        "     - loopback plug for X83 required\n"
        "fkt rs232 number\n"
        "     - loopback plug(s) for X2 required\n"
+#ifndef CONFIG_TQM5200S
        "fkt backlight on/off\n"
        "     - switch backlight on or off\n"
+#endif /* !CONFIG_TQM5200S */
 );
 #elif defined(CONFIG_FO300)
 U_BOOT_CMD(
board/tqm5200/tqm5200.c +2 -1
index 29d6f00..d10cb59 100644
@@ -543,6 +543,7 @@ int last_stage_init (void)
                __asm__ volatile ("sync");
        }
 
+#ifndef CONFIG_TQM5200S        /* The TQM5200S has no SM501 grafic controller */
        /*
         * Check for Grafic Controller
         */
@@ -586,6 +587,7 @@ int last_stage_init (void)
 #endif
 
        return 0;
+#endif /* !CONFIG_TQM5200S */
 }
 
 #ifdef CONFIG_VIDEO_SM501
 
 
-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
#2 lore raw

PATCH 1/1 TQM5200S: fix commands for STK52xx base board because of missing SM501 grafic controller

In reply to Martin Krause
Quoted 9 lines · In message <[email protected]> you wrote:

Some commands for the STK52xx base board try to access the SM501 grafic controller. But the TQM5200S has no grafic controller (only the TQM5200 and the TQM5200B have). This patch deactivates the commands accessing the SM501 for the TQM5200S.

---
If I receive no negative comments to this patch, I will pick it to the u-boot-tq-group repository and send a pull request.

Applied directly, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
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
"Don't think; let the machine do it for you!"        - E. C. Berkeley