[Skyeye-developer] SF.net SVN: skyeye: [312] skyeye-v1/trunk
Michael.Kang
blackfin.kang at gmail.com
Sun Oct 7 17:49:42 CST 2007
Revision: 312
http://skyeye.svn.sourceforge.net/skyeye/?rev=312&view=rev
Author: kangsh
Date: 2007-10-07 02:47:11 -0700 (Sun, 07 Oct 2007)
Log Message:
-----------
commit the patch provided by rayx, that make rtl22xx BSP of RTEMS run on
SkyEye.
Modified Paths:
--------------
skyeye-v1/trunk/ChangeLog
skyeye-v1/trunk/arch/arm/mach/skyeye_mach_lpc2210.c
Modified: skyeye-v1/trunk/ChangeLog
===================================================================
--- skyeye-v1/trunk/ChangeLog 2007-09-17 09:49:15 UTC (rev 311)
+++ skyeye-v1/trunk/ChangeLog 2007-10-07 09:47:11 UTC (rev 312)
@@ -1,3 +1,8 @@
+2007-10-07 Michael.Kang
+ * commit the patch provided by rayx, that fix some bugs in lpc
simulation
+ * Now rtl22xx BSP of RTEMS can run on SkyEye.
+ * Changed files:
+ arch/arm/mach/skyeye_mach_lpc2210.c
2007-09-07 Michael.Kang
* A lot of improvement for ppc simualtion
* timer interrupt seems work normally
Modified: skyeye-v1/trunk/arch/arm/mach/skyeye_mach_lpc2210.c
===================================================================
--- skyeye-v1/trunk/arch/arm/mach/skyeye_mach_lpc2210.c 2007-09-17
09:49:15 UTC (rev 311)
+++ skyeye-v1/trunk/arch/arm/mach/skyeye_mach_lpc2210.c 2007-10-07
09:47:11 UTC (rev 312)
@@ -18,7 +18,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
*/
+
/*
+ * 10/02/2007 Add support for RTEMS/lpc2210 bsp. Be care that the clock in
+ * skyeye lpc2210 support is 1000 times faster than the
real hardware
+ * clock
+ * rayx <rayx.cn at gmail.com>
* 3/24/2003 init this file.
* add machine lpc's function.Most taken from original armio.c
* include: lpc_mach_init, lpc_io_do_cycle
@@ -40,7 +45,7 @@
#define DEBUG 0
#if DEBUG
-#define DBG_PRINT(a...) fprintf(stderr, ##a)
+#define DBG_PRINT(a...) fprintf(stderr,##a)
#else
#define DBG_PRINT(a...)
#endif
@@ -148,10 +153,10 @@
{
u32 irq = 0;
int i;
-// state->NfiqSig = (~(io.vic.RawIntr&io.vic.IntEnable&
io.vic.)) ? LOW : HIGH;
+ //state->NfiqSig = (~(io.vic.RawIntr&io.vic.IntEnable&
io.vic.)) ? LOW : HIGH;
irq = io.vic.RawIntr & io.vic.IntEnable ;
//add by linxz
- //printf("SKYEYE:RawIntr:%x,IntEnable:%x\n", io.vic.RawIntr,
io.vic.IntEnable);
+ //printf("SKYEYE:RawIntr:0x%x,IntEnable:0x%x\n",
io.vic.RawIntr, io.vic.IntEnable);
io.vic.IRQStatus = irq & ~io.vic.IntSelect;
io.vic.FIQStatus = irq & io.vic.IntSelect;
@@ -193,6 +198,7 @@
//io.timer[0].pr = 500000;/*prescale value*/
//rmked by linxz
io.timer[0].pr = 0;
+ io.pll.stat |= 1<<10; /*PLL state register should be 1<<10
when hardware ready*/
io.vic.IRQStatus = 0;
io.vic.FIQStatus = 0;
@@ -200,9 +206,9 @@
//added by linxz
io.vic.IntSelect = 0;
- io.uart[0].lsr = 0x60;
+ io.uart[0].lsr |= 0x60;
io.uart[0].iir = 0x01;
-
+
io.pinsel0 = 0;
io.pinsel1 = 0x15400000;
//io.pinsel2 = FIX ME
@@ -223,16 +229,15 @@
io.timer[0].pc++;
io.timer[1].pc++;
//add by linxz
- //printf("SKYEYE:Timer0 PC:%d, TC:%d", io.timer[0].pc, io.timer[0].tc);
+ //printf("SKYEYE:Timer0 PC:%d, TC:%d\n", io.timer[0].pc,
io.timer[0].tc);
//printf(",MR0:%d,PR:%d,RISR:%d,IER:%d,ISLR:%d,ISR:%d\n",
io.timer[0].mr0, io.timer[0].pr, io.vic.RawIntr, io.vic.IntEnable,
io.vic.IntSelect, io.vic.IRQStatus);
- if (!(io.vic.RawIntr & IRQ_TC0)) { //no timer0 int now
- if (io.timer[0].pc >= io.timer[0].pr+1) {
- // if (io.timer[0].pc >= 5000+1) {
+ if (!(io.vic.RawIntr & IRQ_TC0)) { //no timer0 int yet
+ if (io.timer[0].pc >= io.timer[0].pr+1) {
io.timer[0].tc++;
io.timer[0].pc = 0;
- if(io.timer[0].tc == io.timer[0].mr0){
+ if(io.timer[0].tc >= io.timer[0].mr0/1000)
/*Skyeye's clock is far more slow than the real Ocs. I have to make
the clock interrupt come quicker*/{
// if(io.timer[0].tc == 20){
- io.vic.RawIntr |= IRQ_TC0;
+ io.vic.RawIntr |= IRQ_TC0;
io.timer[0].tc = 0;
//add by linxz
//printf("\r\nI\r\n");
@@ -454,7 +459,7 @@
data = io.pll.cfg;
break;
case 0xe01fc088:
- data = io.pll.stat;
+ data = io.pll.stat|1<<10; /*skyeye should aways return
a pll ready*/
break;
case 0xe01fc08c:
data = io.pll.feed;
@@ -582,7 +587,7 @@
void lpc2210_io_write_byte(ARMul_State *state, ARMword addr, ARMword data)
{
- lpc2210_io_write_word(state,addr,data);
+ lpc2210_io_write_word(state,addr,data);
//SKYEYE_OUTREGS(stderr);
//exit(-1);
@@ -680,7 +685,6 @@
case 0xe0004000:
io.timer[0].ir = data;
if(io.timer[0].ir&0x1){
- io.timer[0].ir &= 0x0;
io.vic.RawIntr &= ~IRQ_TC0;
}
lpc2210_update_int(state);
@@ -699,9 +703,9 @@
break;
case 0xe0004014:
io.timer[0].mcr = data;
- break;
+ break;
case 0xe0004018:
- io.timer[0].mr0 = data;
+ io.timer[0].mr0 = data;
break;
/*pll*/
@@ -848,6 +852,4 @@
//*state->io.instr = (ARMword *)&io.intsr;
//state->io->net_flags = (ARMword *)&io.net_flags;
//state->mach_io.net_int = (ARMword *)&io.net_int;
-
-
}
This was sent by the SourceForge.net collaborative development
platform, the world's largest Open Source development site.
--
www.skyeye.org
More information about the Skyeye-developer
mailing list