Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
9f96ae44
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9f96ae44
编写于
8月 30, 2005
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add keyboard and dot matrix display support for HMI1001 board.
上级
7bc5ee07
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
224 addition
and
7 deletion
+224
-7
board/hmi1001/hmi1001.c
board/hmi1001/hmi1001.c
+118
-0
common/Makefile
common/Makefile
+6
-3
common/cmd_display.c
common/cmd_display.c
+82
-0
include/cmd_confdefs.h
include/cmd_confdefs.h
+2
-1
include/configs/hmi1001.h
include/configs/hmi1001.h
+16
-3
未找到文件。
board/hmi1001/hmi1001.c
浏览文件 @
9f96ae44
...
...
@@ -156,8 +156,126 @@ int checkboard (void)
return
0
;
}
#ifdef CONFIG_PREBOOT
static
uchar
kbd_magic_prefix
[]
=
"key_magic"
;
static
uchar
kbd_command_prefix
[]
=
"key_cmd"
;
#define S1_ROT 0xf0
#define S2_Q 0x40
#define S2_M 0x20
struct
kbd_data_t
{
char
s1
;
char
s2
;
};
struct
kbd_data_t
*
get_keys
(
struct
kbd_data_t
*
kbd_data
)
{
kbd_data
->
s1
=
*
((
volatile
uchar
*
)(
CFG_STATUS1_BASE
));
kbd_data
->
s2
=
*
((
volatile
uchar
*
)(
CFG_STATUS2_BASE
));
return
kbd_data
;
}
static
int
compare_magic
(
struct
kbd_data_t
*
kbd_data
,
uchar
*
str
)
{
char
s1
=
str
[
0
];
char
s2
;
if
(
s1
>=
'0'
&&
s1
<=
'9'
)
s1
-=
'0'
;
else
if
(
s1
>=
'a'
&&
s1
<=
'f'
)
s1
=
s1
-
'a'
+
10
;
else
if
(
s1
>=
'A'
&&
s1
<=
'F'
)
s1
=
s1
-
'A'
+
10
;
else
return
-
1
;
if
(((
S1_ROT
&
kbd_data
->
s1
)
>>
4
)
!=
s1
)
return
-
1
;
s2
=
(
S2_Q
|
S2_M
)
&
kbd_data
->
s2
;
switch
(
str
[
1
])
{
case
'q'
:
case
'Q'
:
if
(
s2
==
S2_Q
)
return
-
1
;
break
;
case
'm'
:
case
'M'
:
if
(
s2
==
S2_M
)
return
-
1
;
break
;
case
'\0'
:
if
(
s2
==
(
S2_Q
|
S2_M
))
return
0
;
default:
return
-
1
;
}
if
(
str
[
2
])
return
-
1
;
return
0
;
}
static
uchar
*
key_match
(
const
struct
kbd_data_t
*
kbd_data
)
{
uchar
magic
[
sizeof
(
kbd_magic_prefix
)
+
1
];
uchar
*
suffix
;
uchar
*
kbd_magic_keys
;
/*
* The following string defines the characters that can be appended
* to "key_magic" to form the names of environment variables that
* hold "magic" key codes, i. e. such key codes that can cause
* pre-boot actions. If the string is empty (""), then only
* "key_magic" is checked (old behaviour); the string "125" causes
* checks for "key_magic1", "key_magic2" and "key_magic5", etc.
*/
if
((
kbd_magic_keys
=
getenv
(
"magic_keys"
))
==
NULL
)
kbd_magic_keys
=
""
;
/* loop over all magic keys;
* use '\0' suffix in case of empty string
*/
for
(
suffix
=
kbd_magic_keys
;
*
suffix
||
suffix
==
kbd_magic_keys
;
++
suffix
)
{
sprintf
(
magic
,
"%s%c"
,
kbd_magic_prefix
,
*
suffix
);
if
(
compare_magic
(
kbd_data
,
getenv
(
magic
))
==
0
)
{
uchar
cmd_name
[
sizeof
(
kbd_command_prefix
)
+
1
];
char
*
cmd
;
sprintf
(
cmd_name
,
"%s%c"
,
kbd_command_prefix
,
*
suffix
);
cmd
=
getenv
(
cmd_name
);
return
(
cmd
);
}
}
return
(
NULL
);
}
#endif
/* CONFIG_PREBOOT */
int
misc_init_f
(
void
)
{
}
int
misc_init_r
(
void
)
{
#ifdef CONFIG_PREBOOT
struct
kbd_data_t
kbd_data
;
/* Decode keys */
uchar
*
str
=
strdup
(
key_match
(
get_keys
(
&
kbd_data
)));
/* Set or delete definition */
setenv
(
"preboot"
,
str
);
free
(
str
);
#endif
/* CONFIG_PREBOOT */
return
0
;
}
...
...
common/Makefile
浏览文件 @
9f96ae44
...
...
@@ -31,7 +31,7 @@ COBJS = main.o ACEX1K.o altera.o bedbug.o circbuf.o \
cmd_ace.o cmd_autoscript.o
\
cmd_bdinfo.o cmd_bedbug.o cmd_bmp.o cmd_boot.o cmd_bootm.o
\
cmd_cache.o cmd_console.o
\
cmd_date.o cmd_dcr.o cmd_diag.o cmd_doc.o cmd_dtt.o
\
cmd_date.o cmd_dcr.o cmd_diag.o cmd_d
isplay.o cmd_d
oc.o cmd_dtt.o
\
cmd_eeprom.o cmd_elf.o cmd_ext2.o
\
cmd_fat.o cmd_fdc.o cmd_fdos.o cmd_flash.o cmd_fpga.o
\
cmd_i2c.o cmd_ide.o cmd_immap.o cmd_itest.o cmd_jffs2.o
\
...
...
@@ -39,10 +39,13 @@ COBJS = main.o ACEX1K.o altera.o bedbug.o circbuf.o \
cmd_mem.o cmd_mii.o cmd_misc.o cmd_mmc.o
\
cmd_nand.o cmd_net.o cmd_nvedit.o
\
cmd_pci.o cmd_pcmcia.o cmd_portio.o
\
cmd_reginfo.o cmd_reiser.o cmd_scsi.o cmd_spi.o cmd_universe.o cmd_usb.o cmd_vfd.o
\
cmd_reginfo.o cmd_reiser.o cmd_scsi.o cmd_spi.o cmd_universe.o
\
cmd_usb.o cmd_vfd.o
\
command.o console.o devices.o dlmalloc.o docecc.o
\
environment.o env_common.o
\
env_nand.o env_dataflash.o env_flash.o env_eeprom.o env_nvram.o env_nowhere.o exports.o
\
env_nand.o env_dataflash.o env_flash.o env_eeprom.o
\
env_nvram.o env_nowhere.o
\
exports.o
\
flash.o fpga.o
\
hush.o kgdb.o lcd.o lists.o lynxkdi.o
\
memsize.o miiphybb.o miiphyutil.o
\
...
...
common/cmd_display.c
0 → 100644
浏览文件 @
9f96ae44
/*
* (C) Copyright 2005
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* 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
*/
#include <common.h>
#include <command.h>
#if (CONFIG_COMMANDS & CFG_CMD_DISPLAY)
#undef DEBUG_DISP
#define DISP_SIZE 8
#define CWORD_CLEAR 0x80
#define CLEAR_DELAY (110 * 2)
int
do_display
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[])
{
int
i
;
int
pos
;
/* Clear display */
*
((
volatile
char
*
)(
CFG_DISP_CWORD
))
=
CWORD_CLEAR
;
udelay
(
1000
*
CLEAR_DELAY
);
if
(
argc
<
2
)
return
(
0
);
for
(
pos
=
0
,
i
=
1
;
i
<
argc
&&
pos
<
DISP_SIZE
;
i
++
)
{
char
*
p
=
argv
[
i
],
c
;
if
(
i
>
1
)
{
*
((
volatile
uchar
*
)
(
CFG_DISP_CHR_RAM
+
pos
++
))
=
' '
;
#ifdef DEBUG_DISP
putc
(
' '
);
#endif
}
while
((
c
=
*
p
++
)
!=
'\0'
&&
pos
<
DISP_SIZE
)
{
*
((
volatile
uchar
*
)
(
CFG_DISP_CHR_RAM
+
pos
++
))
=
c
;
#ifdef DEBUG_DISP
putc
(
c
);
#endif
}
}
#ifdef DEBUG_DISP
putc
(
'\n'
);
#endif
return
(
0
);
}
/***************************************************/
U_BOOT_CMD
(
display
,
CFG_MAXARGS
,
1
,
do_display
,
"display- display string on dot matrix display
\n
"
,
"[<string>]
\n
"
" - with <string> argument: display <string> on dot matrix display
\n
"
" - without arguments: clear dot matrix display
\n
"
);
#endif
/* CFG_CMD_DISPLAY */
include/cmd_confdefs.h
浏览文件 @
9f96ae44
...
...
@@ -91,8 +91,9 @@
#define CFG_CMD_CDP 0x0200000000000000ULL
/* Cisco Discovery Protocol */
#define CFG_CMD_XIMG 0x0400000000000000ULL
/* Load part of Multi Image */
#define CFG_CMD_UNIVERSE 0x0800000000000000ULL
/* Tundra Universe Support */
#define CFG_CMD_EXT2
0x1000000000000000ULL
/* EXT2 Support
*/
#define CFG_CMD_EXT2
0x1000000000000000ULL
/* EXT2 Support
*/
#define CFG_CMD_SNTP 0x2000000000000000ULL
/* SNTP support */
#define CFG_CMD_DISPLAY 0x4000000000000000ULL
/* Display support */
#define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFULL
/* ALL commands */
...
...
include/configs/hmi1001.h
浏览文件 @
9f96ae44
...
...
@@ -60,13 +60,14 @@
*/
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
CFG_CMD_DATE | \
CFG_CMD_DISPLAY | \
CFG_CMD_DHCP | \
CFG_CMD_EEPROM | \
CFG_CMD_I2C | \
CFG_CMD_IDE | \
CFG_CMD_NFS | \
CFG_CMD_PCI | \
CFG_CMD_SNTP)
CFG_CMD_SNTP
)
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
...
...
@@ -104,6 +105,8 @@
#define CONFIG_BOOTCOMMAND "run net_nfs"
#define CONFIG_MISC_INIT_R 1
/*
* IPB Bus clocking configuration.
*/
...
...
@@ -166,6 +169,9 @@
#define CFG_MBAR 0xF0000000
#define CFG_SDRAM_BASE 0x00000000
#define CFG_DEFAULT_MBAR 0x80000000
#define CFG_DISPLAY_BASE 0x80600000
#define CFG_STATUS1_BASE 0x80600200
#define CFG_STATUS2_BASE 0x80600300
/* Settings for XLB = 132 MHz */
#define SDRAM_DDR 1
...
...
@@ -269,8 +275,8 @@
/* Display H1, Status Inputs, EPLD @0x80600000 */
#define CFG_CS3_START 0x80600000
#define CFG_CS3_SIZE 0x00
00021
0
#define CFG_CS3_CFG 0x
980
0
#define CFG_CS3_SIZE 0x00
10000
0
#define CFG_CS3_CFG 0x
ffff983
0
#define CFG_CS_BURST 0x00000000
#define CFG_CS_DEADCYCLE 0x33333333
...
...
@@ -325,4 +331,11 @@
#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
#define CONFIG_PCI_IO_SIZE 0x01000000
/*---------------------------------------------------------------------*/
/* Display addresses */
/*---------------------------------------------------------------------*/
#define CFG_DISP_CHR_RAM (CFG_DISPLAY_BASE + 0x38)
#define CFG_DISP_CWORD (CFG_DISPLAY_BASE + 0x30)
#endif
/* __CONFIG_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录