ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: On using the PC-104 bus of a TS7800 board

To:
Subject: Re: [ts-7000] Re: On using the PC-104 bus of a TS7800 board
From: Bill Whiteley <>
Date: Thu, 29 Jan 2009 10:04:06 -0500
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.

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

__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU