Change boot command to boot kernel from 0xc1028380
[u-boot-m93030.git] / board / tqc / tqm5200 / cmd_tb5200.c
blob214dca65e534c2c97ac12ae8f4a87b356179697f
1 /*
2 * (C) Copyright 2005 - 2006
3 * Martin Krause, TQ-Systems GmbH, martin.krause@tqs.de.
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
25 * TB5200 specific functions
27 /*#define DEBUG*/
29 #include <common.h>
30 #include <command.h>
32 #if defined(CONFIG_CMD_BSP)
33 #if defined (CONFIG_TB5200)
35 #define SM501_PANEL_DISPLAY_CONTROL 0x00080000UL
37 static void led_init(void)
39 struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT;
41 /* configure timer 4 for simple GPIO output */
42 gpt->gpt4.emsr |= 0x00000024;
45 int cmd_led(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
47 struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT;
49 led_init();
51 if (strcmp (argv[1], "on") == 0) {
52 debug ("switch status LED on\n");
53 gpt->gpt4.emsr |= (1 << 4);
54 } else if (strcmp (argv[1], "off") == 0) {
55 debug ("switch status LED off\n");
56 gpt->gpt4.emsr &= ~(1 << 4);
57 } else {
58 printf ("Usage:\nled on/off\n");
59 return 1;
62 return 0;
65 static void sm501_backlight (unsigned int state)
67 if (state == 1) {
68 *(vu_long *)(SM501_MMIO_BASE+SM501_PANEL_DISPLAY_CONTROL) |=
69 (1 << 26) | (1 << 27);
70 } else if (state == 0)
71 *(vu_long *)(SM501_MMIO_BASE+SM501_PANEL_DISPLAY_CONTROL) &=
72 ~((1 << 26) | (1 << 27));
75 int cmd_backlight(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
77 if (strcmp (argv[1], "on") == 0) {
78 debug ("switch backlight on\n");
79 sm501_backlight (1);
80 } else if (strcmp (argv[1], "off") == 0) {
81 debug ("switch backlight off\n");
82 sm501_backlight (0);
83 } else {
84 printf ("Usage:\nbacklight on/off\n");
85 return 1;
88 return 0;
91 U_BOOT_CMD(
92 led , 2, 1, cmd_led,
93 "led - switch status LED on or off\n",
94 "on/off\n"
97 U_BOOT_CMD(
98 backlight , 2, 1, cmd_backlight,
99 "backlight - switch backlight on or off\n",
100 "on/off\n"
103 #endif /* CONFIG_STK52XX */
104 #endif