Bill Whiteley wrote:
> It sounds like you are already doing this correctly, but below is the
> function that I use to enable the PC104 bus on the 7800 to access
> expansion boards.
> It is part of a larger class but I think clearly demonstrates how to
> convert the PC104 bus to ISA.
Hi Bill,
Thanks for your help, what i'm doing from the shell prompt is the same
as you do in your class.
And actually, for now:
- i'm able to speak with a TS-GSM1 on the bus,
- i'm not able to speak really to a TS-BAT3 on the bus.
- and i'm still not able to speak to my others boards.
Concerning the TS-BAT3 problem, the bat3 program says "Failed to
communicate with AVR", but i was able to load the uart driver for bat3
(so it means the driver saws the board), i got this kernel messages:
TS-UART/BAT3 found at port 0x0100
ttts10 at MMIO 0xee000102 (irq = 69) is a TSUART
Having had a look with strace, i'm sure the bat3 prog open the right
serial device, but there's no data coming from it, so it ends with a
timeout:
:root# ls -l /dev/tsbat3
lrwxrwxrwx 1 root root 11 Jan 29 16:22 /dev/tsbat3 -> /dev/ttts10
:root# strace ./bat3
...
open("/dev/tsbat3", O_RDWR) = 3
fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, TCFLSH, 0) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon
-echo ...}) = 0
select(4, [3], NULL, NULL, {0, 250000}) = 0 (Timeout)
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 64), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon
echo ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40016000
write(1, "Failed to communicate with AVR\n", 31Failed to communicate
with AVR
) = 31
...
Regards,
Chris
>
> Maybe it will be helpful.
>
> #define ARM9_REGISTER 0xE8000000 //ARM9 registers
>
> int TS7800_ExpansionBoard::setPC104toISA()
> {
> volatile unsigned int *regs;
>
> //Check to make sure we have a FD for memory device
> if ( _intDevMem < 1 )
> {
> openMemoryMapDevice(O_RDWR|O_SYNC);
> }
>
> //Get pointer to base address
> regs = (unsigned int *)mmap(0, getpagesize(), PROT_READ|PROT_WRITE,
> MAP_SHARED, _intDevMem, ARM9_REGISTER);
>
> if ( regs == MAP_FAILED )
> {
> // TODO: Log the error
> perror("Error occurred while getting memory map file.\n");
> exit(1);
>
> }
>
> //Set the PC104 bus to ISA so we can talk to peripheral devices
> *(regs + 0x30/sizeof(unsigned int)) = 0x55555555;
> *(regs + 0x34/sizeof(unsigned int)) = 0x55555555;
> *(regs + 0x38/sizeof(unsigned int)) = 0x55555;
> *(regs + 0x3C/sizeof(unsigned int)) = 0x55555;
>
> //Unmap the memory map since we are done with it
> munmap((void *)regs, getpagesize());
> regs = NULL;
>
> return 0;
> }
>
> On Thu, Jan 29, 2009 at 5:21 AM, Christian Gagneraud
> < <>> wrote:
>
> charliem_1216 wrote:
> > Hi Chris --
> >
> > --- In
> <ts-7000%40yahoogroups.com>, Christian Gagneraud <>
> > wrote:
> >> Hi there,
> >>
> >> According to the ts7800 manual, there's a register at address
> >> 0xE800000C to control the timing of the PC/104 bus, and this
> register
> >> should contains some default power-on values.
> >
> > IIRC, the ts7800 comes up in GPIO mode, and you have to switch to
> > ISA/PC-104 mode by writing to some registers. Are you doing that
> already?
>
> Yes, I do. Thre's 4 registers for this purpose. But then there is this
> one to fine-tuned the bus timing...
>
>
> >
> > regards, ........ Charlie
> >
> >> My problem is that if i read the register with a "peek32
> 0xE800000C",
> >> i get 0x16bdc, which doesn't correspond to the expected value.
> For a
> >> default ISA strobe length of 40 and a default setup length of 14, i
> >> should get something like 0x162A8.
> >>
> >> If i try with 0x162FF (max timing), the system freeze as soon as
> i try
> >> to read anything. 0x162A8 seems to work better, i can see that the
> >> peripheral board is accessed (there's a LED that show PC104
> access on
> >> it), but the values returned looks a bit random.
> >>
> >> I would like to configure the ISA bus in a state which will be as
> >> compatible as possible with the ISA specs.
> >> Can anyone explain me why do i get these default power-on
> values? And
> >> which value will really put me into a kind of ISA compliant mode?
> >>
> >> I tried to play with this register, since i can't get a peripheral
> >> board working, the kernel module need to read/write a couple of
> >> registers on the bus, unfortunately reading these registers return
> >> always 0, and i'm sure that i should get something different.
> >> Basically, here is what the code is doing:
> >>
> >> // board configured for ISA address 0x180
> >> int io_base = 0xEE000000 + 0x180
> >> volatile uint8_t* reg_base = __ioremap( io_base, 4096, 0);
> >> uint8_t value = *reg_base;
> >> // value is always 0x00 with peek32 0xE800000C 0x16bdc
> >> // value looks a bit random with peek32 0xE800000C 0x162A8
> >>
> >> With best regards,
> >> Chris
> >>
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
>
>
>
> --
> Bill Whiteley
> <>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|