Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
f5300ab2
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,发现更多精彩内容 >>
提交
f5300ab2
编写于
9月 12, 2003
作者:
W
wdenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move TRAB burn-in tests to TRAB board directory
上级
68ce8957
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
1376 addition
and
25 deletion
+1376
-25
Makefile
Makefile
+3
-2
board/trab/Makefile
board/trab/Makefile
+18
-0
board/trab/rs485.c
board/trab/rs485.c
+203
-0
board/trab/rs485.h
board/trab/rs485.h
+37
-0
board/trab/trab_fkt.c
board/trab/trab_fkt.c
+1093
-0
board/trab/tsc2000.c
board/trab/tsc2000.c
+10
-8
board/trab/tsc2000.h
board/trab/tsc2000.h
+8
-10
examples/Makefile
examples/Makefile
+0
-5
include/_exports.h
include/_exports.h
+2
-0
include/exports.h
include/exports.h
+2
-0
未找到文件。
Makefile
浏览文件 @
f5300ab2
...
@@ -76,6 +76,7 @@ export CROSS_COMPILE
...
@@ -76,6 +76,7 @@ export CROSS_COMPILE
# The "tools" are needed early, so put this first
# The "tools" are needed early, so put this first
SUBDIRS
=
tools
\
SUBDIRS
=
tools
\
examples
\
lib_generic
\
lib_generic
\
lib_
$(ARCH)
\
lib_
$(ARCH)
\
cpu/
$(CPU)
\
cpu/
$(CPU)
\
...
@@ -89,8 +90,7 @@ SUBDIRS = tools \
...
@@ -89,8 +90,7 @@ SUBDIRS = tools \
drivers
\
drivers
\
drivers/sk98lin
\
drivers/sk98lin
\
post
\
post
\
post/cpu
\
post/cpu
examples
#########################################################################
#########################################################################
# U-Boot objects....order is important (i.e. start must be first)
# U-Boot objects....order is important (i.e. start must be first)
...
@@ -921,6 +921,7 @@ clean:
...
@@ -921,6 +921,7 @@ clean:
rm
-f
tools/gdb/astest
tools/gdb/gdbcont
tools/gdb/gdbsend
rm
-f
tools/gdb/astest
tools/gdb/gdbcont
tools/gdb/gdbsend
rm
-f
tools/env/fw_printenv
tools/env/fw_setenv
rm
-f
tools/env/fw_printenv
tools/env/fw_setenv
rm
-f
board/cray/L1/bootscript.c
board/cray/L1/bootscript.image
rm
-f
board/cray/L1/bootscript.c
board/cray/L1/bootscript.image
rm
-f
board/trab/trab_fkt
clobber
:
clean
clobber
:
clean
find
.
-type
f
\
find
.
-type
f
\
...
...
board/trab/Makefile
浏览文件 @
f5300ab2
...
@@ -28,9 +28,27 @@ LIB = lib$(BOARD).a
...
@@ -28,9 +28,27 @@ LIB = lib$(BOARD).a
OBJS
:=
trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o
OBJS
:=
trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o
SOBJS
:=
memsetup.o
SOBJS
:=
memsetup.o
gcclibdir
:=
$(
shell
dirname
`
$(CC)
-print-libgcc-file-name
`
)
LOAD_ADDR
=
0xc100000
#########################################################################
all
:
$(LIB) trab_fkt.srec trab_fkt.bin
$(LIB)
:
$(OBJS) $(SOBJS)
$(LIB)
:
$(OBJS) $(SOBJS)
$(AR)
crv
$@
$(OBJS)
$(SOBJS)
$(AR)
crv
$@
$(OBJS)
$(SOBJS)
trab_fkt.srec
:
trab_fkt.o rs485.o tsc2000.o $(LIB)
$(LD)
-g
-Ttext
$(LOAD_ADDR)
-o
$
(
<:.o
=)
-e
$
(
<:.o
=)
$^
$(LIB)
\
-L
../../examples
-lstubs
\
-L
../../lib_generic
-lgeneric
\
-L
$(gcclibdir)
-lgcc
$(OBJCOPY)
-O
srec
$
(
<:.o
=)
$@
trab_fkt.bin
:
trab_fkt.srec
$(OBJCOPY)
-O
binary
$<
$@
2>/dev/null
clean
:
clean
:
rm
-f
$(SOBJS)
$(OBJS)
rm
-f
$(SOBJS)
$(OBJS)
...
...
board/trab/rs485.c
0 → 100644
浏览文件 @
f5300ab2
/*
* (C) Copyright 2003
* Martin Krause, TQ-Systems GmbH, <martin.krause@tqs.de>
*
* Based on cpu/arm920t/serial.c, by Gary Jennejohn
* (C) Copyright 2002 Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* 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 <s3c2400.h>
#include "rs485.h"
static
void
rs485_setbrg
(
void
);
static
void
rs485_cfgio
(
void
);
static
void
set_rs485re
(
unsigned
char
rs485re_state
);
static
void
set_rs485de
(
unsigned
char
rs485de_state
);
static
void
rs485_setbrg
(
void
);
#ifdef NOT_USED
static
void
trab_rs485_disable_tx
(
void
);
static
void
trab_rs485_disable_rx
(
void
);
#endif
#define UART_NR S3C24X0_UART1
/* CPLD-Register for controlling TRAB hardware functions */
#define CPLD_RS485_RE ((volatile unsigned long *)0x04028000)
static
void
rs485_setbrg
(
void
)
{
S3C24X0_UART
*
const
uart
=
S3C24X0_GetBase_UART
(
UART_NR
);
int
i
;
unsigned
int
reg
=
0
;
/* value is calculated so : (int)(PCLK/16./baudrate) -1 */
/* reg = (33000000 / (16 * gd->baudrate)) - 1; */
reg
=
(
33000000
/
(
16
*
38
.
400
))
-
1
;
/* FIFO enable, Tx/Rx FIFO clear */
uart
->
UFCON
=
0x07
;
uart
->
UMCON
=
0x0
;
/* Normal,No parity,1 stop,8 bit */
uart
->
ULCON
=
0x3
;
/*
* tx=level,rx=edge,disable timeout int.,enable rx error int.,
* normal,interrupt or polling
*/
uart
->
UCON
=
0x245
;
uart
->
UBRDIV
=
reg
;
for
(
i
=
0
;
i
<
100
;
i
++
);
}
static
void
rs485_cfgio
(
void
)
{
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
gpio
->
PFCON
&=
~
(
0x3
<<
2
);
gpio
->
PFCON
|=
(
0x2
<<
2
);
/* configure GPF1 as RXD1 */
gpio
->
PFCON
&=
~
(
0x3
<<
6
);
gpio
->
PFCON
|=
(
0x2
<<
6
);
/* configure GPF3 as TXD1 */
gpio
->
PFUP
|=
(
1
<<
1
);
/* disable pullup on GPF1 */
gpio
->
PFUP
|=
(
1
<<
3
);
/* disable pullup on GPF3 */
gpio
->
PACON
&=
~
(
1
<<
11
);
/* set GPA11 (RS485_DE) to output */
}
/*
* Initialise the rs485 port with the given baudrate. The settings
* are always 8 data bits, no parity, 1 stop bit, no start bits.
*
*/
int
rs485_init
(
void
)
{
rs485_cfgio
();
rs485_setbrg
();
return
(
0
);
}
/*
* Read a single byte from the rs485 port. Returns 1 on success, 0
* otherwise. When the function is succesfull, the character read is
* written into its argument c.
*/
int
rs485_getc
(
void
)
{
S3C24X0_UART
*
const
uart
=
S3C24X0_GetBase_UART
(
UART_NR
);
/* wait for character to arrive */
while
(
!
(
uart
->
UTRSTAT
&
0x1
));
return
uart
->
URXH
&
0xff
;
}
/*
* Output a single byte to the rs485 port.
*/
void
rs485_putc
(
const
char
c
)
{
S3C24X0_UART
*
const
uart
=
S3C24X0_GetBase_UART
(
UART_NR
);
/* wait for room in the tx FIFO */
while
(
!
(
uart
->
UTRSTAT
&
0x2
));
uart
->
UTXH
=
c
;
/* If \n, also do \r */
if
(
c
==
'\n'
)
rs485_putc
(
'\r'
);
}
/*
* Test whether a character is in the RX buffer
*/
int
rs485_tstc
(
void
)
{
S3C24X0_UART
*
const
uart
=
S3C24X0_GetBase_UART
(
UART_NR
);
return
uart
->
UTRSTAT
&
0x1
;
}
void
rs485_puts
(
const
char
*
s
)
{
while
(
*
s
)
{
rs485_putc
(
*
s
++
);
}
}
/*
* State table:
* RE DE Result
* 1 1 XMIT
* 0 0 RCV
* 1 0 Shutdown
*/
/* function that controls the receiver enable for the rs485 */
/* rs485re_state reflects the level (0/1) of the RE pin */
static
void
set_rs485re
(
unsigned
char
rs485re_state
)
{
if
(
rs485re_state
)
*
CPLD_RS485_RE
=
0x010000
;
else
*
CPLD_RS485_RE
=
0x0
;
}
/* function that controls the sender enable for the rs485 */
/* rs485de_state reflects the level (0/1) of the DE pin */
static
void
set_rs485de
(
unsigned
char
rs485de_state
)
{
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
/* This is on PORT A bit 11 */
if
(
rs485de_state
)
gpio
->
PADAT
|=
(
1
<<
11
);
else
gpio
->
PADAT
&=
~
(
1
<<
11
);
}
void
trab_rs485_enable_tx
(
void
)
{
set_rs485de
(
1
);
set_rs485re
(
1
);
}
void
trab_rs485_enable_rx
(
void
)
{
set_rs485re
(
0
);
set_rs485de
(
0
);
}
#ifdef NOT_USED
static
void
trab_rs485_disable_tx
(
void
)
{
set_rs485de
(
0
);
}
static
void
trab_rs485_disable_rx
(
void
)
{
set_rs485re
(
1
);
}
#endif
board/trab/rs485.h
0 → 100644
浏览文件 @
f5300ab2
/*
* (C) Copyright 2003
* Martin Krause, TQ-Systems GmbH, <martin.krause@tqs.de>
*
* Based on cpu/arm920t/serial.c, by Gary Jennejohn
* (C) Copyright 2002 Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* 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
*
*/
#ifndef _RS485_H_
#define _RS485_H_
#include <s3c2400.h>
int
rs485_init
(
void
);
int
rs485_getc
(
void
);
void
rs485_putc
(
const
char
c
);
int
rs485_tstc
(
void
);
void
rs485_puts
(
const
char
*
s
);
void
trab_rs485_enable_tx
(
void
);
void
trab_rs485_enable_rx
(
void
);
#endif
/* _RS485_H_ */
board/trab/trab_fkt.c
0 → 100644
浏览文件 @
f5300ab2
此差异已折叠。
点击以展开。
board/trab/tsc2000.c
浏览文件 @
f5300ab2
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include <s3c2400.h>
#include <s3c2400.h>
#include "tsc2000.h"
#include "tsc2000.h"
#include "Pt1000_temp_data.h"
void
spi_init
(
void
)
void
spi_init
(
void
)
{
{
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
...
@@ -56,7 +58,7 @@ void spi_init(void)
...
@@ -56,7 +58,7 @@ void spi_init(void)
}
}
static
void
spi_wait_transmit_done
(
void
)
void
spi_wait_transmit_done
(
void
)
{
{
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
...
@@ -64,7 +66,7 @@ static void spi_wait_transmit_done(void)
...
@@ -64,7 +66,7 @@ static void spi_wait_transmit_done(void)
}
}
static
void
tsc2000_write
(
unsigned
short
reg
,
unsigned
short
data
)
void
tsc2000_write
(
unsigned
short
reg
,
unsigned
short
data
)
{
{
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
unsigned
int
command
;
unsigned
int
command
;
...
@@ -84,7 +86,7 @@ static void tsc2000_write(unsigned short reg, unsigned short data)
...
@@ -84,7 +86,7 @@ static void tsc2000_write(unsigned short reg, unsigned short data)
}
}
static
unsigned
short
tsc2000_read
(
unsigned
short
reg
)
unsigned
short
tsc2000_read
(
unsigned
short
reg
)
{
{
unsigned
short
command
,
data
;
unsigned
short
command
,
data
;
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
S3C24X0_SPI
*
const
spi
=
S3C24X0_GetBase_SPI
();
...
@@ -108,7 +110,7 @@ static unsigned short tsc2000_read (unsigned short reg)
...
@@ -108,7 +110,7 @@ static unsigned short tsc2000_read (unsigned short reg)
}
}
static
void
tsc2000_set_mux
(
unsigned
int
channel
)
void
tsc2000_set_mux
(
unsigned
int
channel
)
{
{
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
...
@@ -185,7 +187,7 @@ static void tsc2000_set_mux (unsigned int channel)
...
@@ -185,7 +187,7 @@ static void tsc2000_set_mux (unsigned int channel)
}
}
static
void
tsc2000_set_range
(
unsigned
int
range
)
void
tsc2000_set_range
(
unsigned
int
range
)
{
{
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
S3C24X0_GPIO
*
const
gpio
=
S3C24X0_GetBase_GPIO
();
...
@@ -206,7 +208,7 @@ static void tsc2000_set_range (unsigned int range)
...
@@ -206,7 +208,7 @@ static void tsc2000_set_range (unsigned int range)
}
}
static
u16
tsc2000_read_channel
(
unsigned
int
channel
)
u16
tsc2000_read_channel
(
unsigned
int
channel
)
{
{
u16
res
;
u16
res
;
...
@@ -284,7 +286,7 @@ void tsc2000_reg_init (void)
...
@@ -284,7 +286,7 @@ void tsc2000_reg_init (void)
}
}
static
int
tsc2000_interpolate
(
long
value
,
long
data
[][
2
],
long
*
result
)
int
tsc2000_interpolate
(
long
value
,
long
data
[][
2
],
long
*
result
)
{
{
int
i
;
int
i
;
...
@@ -311,7 +313,7 @@ static int tsc2000_interpolate(long value, long data[][2], long *result)
...
@@ -311,7 +313,7 @@ static int tsc2000_interpolate(long value, long data[][2], long *result)
}
}
static
void
adc_wait_conversion_done
(
void
)
void
adc_wait_conversion_done
(
void
)
{
{
while
(
!
(
tsc2000_read
(
TSC2000_REG_ADC
)
&
(
1
<<
14
)));
while
(
!
(
tsc2000_read
(
TSC2000_REG_ADC
)
&
(
1
<<
14
)));
}
}
board/trab/tsc2000.h
浏览文件 @
f5300ab2
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
#ifndef _TSC2000_H_
#ifndef _TSC2000_H_
#define _TSC2000_H_
#define _TSC2000_H_
#include "Pt1000_temp_data.h"
/* temperature channel multiplexer definitions */
/* temperature channel multiplexer definitions */
#define CON_MUX0 (gpio->PCCON = (gpio->PCCON & 0x0FFFFFCFF) | 0x00000100)
#define CON_MUX0 (gpio->PCCON = (gpio->PCCON & 0x0FFFFFCFF) | 0x00000100)
#define CLR_MUX0 (gpio->PCDAT &= 0x0FFEF)
#define CLR_MUX0 (gpio->PCDAT &= 0x0FFEF)
...
@@ -116,17 +114,17 @@
...
@@ -116,17 +114,17 @@
#define ERROR_BATTERY 220
/* must be adjusted, if R68 is changed on
#define ERROR_BATTERY 220
/* must be adjusted, if R68 is changed on
* TRAB */
* TRAB */
static
void
tsc2000_write
(
unsigned
short
,
unsigned
short
);
void
tsc2000_write
(
unsigned
short
,
unsigned
short
);
static
unsigned
short
tsc2000_read
(
unsigned
short
);
unsigned
short
tsc2000_read
(
unsigned
short
);
static
u16
tsc2000_read_channel
(
unsigned
int
);
u16
tsc2000_read_channel
(
unsigned
int
);
static
void
tsc2000_set_mux
(
unsigned
int
);
void
tsc2000_set_mux
(
unsigned
int
);
static
void
tsc2000_set_range
(
unsigned
int
);
void
tsc2000_set_range
(
unsigned
int
);
void
tsc2000_reg_init
(
void
);
void
tsc2000_reg_init
(
void
);
s32
tsc2000_contact_temp
(
void
);
s32
tsc2000_contact_temp
(
void
);
static
void
spi_wait_transmit_done
(
void
);
void
spi_wait_transmit_done
(
void
);
void
spi_init
(
void
);
void
spi_init
(
void
);
static
int
tsc2000_interpolate
(
long
value
,
long
data
[][
2
],
long
*
result
);
int
tsc2000_interpolate
(
long
value
,
long
data
[][
2
],
long
*
result
);
static
void
adc_wait_conversion_done
(
void
);
void
adc_wait_conversion_done
(
void
);
static
inline
void
SET_CS_TOUCH
(
void
)
static
inline
void
SET_CS_TOUCH
(
void
)
...
...
examples/Makefile
浏览文件 @
f5300ab2
...
@@ -69,11 +69,6 @@ ifeq ($(BOARD),oxc)
...
@@ -69,11 +69,6 @@ ifeq ($(BOARD),oxc)
SREC
+=
eepro100_eeprom.srec
SREC
+=
eepro100_eeprom.srec
endif
endif
##ifeq ($(BOARD),trab)
##SREC += trab_fkt.srec
##BIN += trab_fkt.bin
##endif
OBJS
=
$(SREC:.srec=.o)
OBJS
=
$(SREC:.srec=.o)
LIB
=
libstubs.a
LIB
=
libstubs.a
...
...
include/_exports.h
浏览文件 @
f5300ab2
...
@@ -10,6 +10,8 @@ EXPORT_FUNC(malloc)
...
@@ -10,6 +10,8 @@ EXPORT_FUNC(malloc)
EXPORT_FUNC
(
free
)
EXPORT_FUNC
(
free
)
EXPORT_FUNC
(
udelay
)
EXPORT_FUNC
(
udelay
)
EXPORT_FUNC
(
get_timer
)
EXPORT_FUNC
(
get_timer
)
EXPORT_FUNC
(
vprintf
)
EXPORT_FUNC
(
do_reset
)
#if (CONFIG_COMMANDS & CFG_CMD_I2C)
#if (CONFIG_COMMANDS & CFG_CMD_I2C)
EXPORT_FUNC
(
i2c_write
)
EXPORT_FUNC
(
i2c_write
)
EXPORT_FUNC
(
i2c_read
)
EXPORT_FUNC
(
i2c_read
)
...
...
include/exports.h
浏览文件 @
f5300ab2
...
@@ -18,6 +18,8 @@ void *malloc(size_t);
...
@@ -18,6 +18,8 @@ void *malloc(size_t);
void
free
(
void
*
);
void
free
(
void
*
);
void
udelay
(
unsigned
long
);
void
udelay
(
unsigned
long
);
unsigned
long
get_timer
(
unsigned
long
);
unsigned
long
get_timer
(
unsigned
long
);
void
vprintf
(
const
char
*
,
va_list
);
void
do_reset
(
void
);
#if (CONFIG_COMMANDS & CFG_CMD_I2C)
#if (CONFIG_COMMANDS & CFG_CMD_I2C)
int
i2c_write
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
int
i2c_write
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
int
i2c_read
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
int
i2c_read
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录