Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
183 user(s) are online (32 user(s) are browsing News)

Members: 3
Guests: 180

trixie, kas1e, NinjaCyborg, more...

Support us!

Headlines


Recent Replied Topics
Hardware News : Zorro II/III DMA USB 2.0 controller for all Zorro capable Amigas!
Posted by mboehmer on 2008/5/7 10:41:51 (3480 reads) News by the same author
Hardware News

Six years after introducing USB to the Amiga Classic, E3B (Michael B?hmer) and PCP (Chris Hodges) are pleased to announce the new USB 2.0 Zorro II/III DMA controller DENEB.

Please read all details of the DENEB on our website in the press release and the product page.

DENEB is available from now on directyl at E3B and selected Amiga dealers.

Printer friendly page Send this story to a friend
The comments are owned by the author. We aren't responsible for their content.
Author Thread
ssolie
Published: 2008/5/7 18:36  Updated: 2008/5/7 18:36
Amigans Defender
Joined: 11/26/2006
From: Canada
Comments: 986
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
It is a pity you were unable resolve the issue regarding AmigaOS 4.0 DMA support. Otherwise, looks like a good product.
mboehmer
Published: 2008/5/7 18:44  Updated: 2008/5/7 18:44
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
It seems that the bug is inside the CachePreDMA() and CachePostDMA() functions. In initial release, they are broken, and in February update they improved, but are not stable, especially if the RAM gets heavily fragmented.

Basic problem is that "old" software usually takes AllocVec() or AllocMem() to get buffer memory for DMA, which is not linear in OS4 anymore.
This could be solved by a complex scatter / gather DMA engine, but reduces efficiency for DMA transactions.
Anyhow, even with the update it doesn't work, and as PIO works fine we didn't follow this issue.

Nevertheless, DMA works in classic 3.x systems, and PIO also in OS 4.x Classic.

Michael
ssolie
Published: 2008/5/7 18:54  Updated: 2008/5/7 18:54
Amigans Defender
Joined: 11/26/2006
From: Canada
Comments: 986
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
You are supposed to use AllocVecTags() to allocate memory for DMA use. You cannot use the old deprecated methods on AmigaOS 4.0.

Unfortunately, this is not yet available in the public SDK but access to it can still be arranged in other ways. Try emailing Evert Carton (EvertC at hyperion-entertainment dot biz) and he should be able to get you access to the headers and autodocs necessary to get the job done.

As for the CachePreDMA() and CachePostDMA() functions, those may still be broken. But it certainly isn't helping the situation when DMA memory is not being allocated in the correct manner.
mboehmer
Published: 2008/5/7 20:13  Updated: 2008/5/7 20:13
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Even as we get offtopic: your help is appreciated, but load of "depreciated" software running in JIT is using these "depreciated" way of allocating memory.

If such a memory is given to Poseidon as DMA buffer, then this is out of control, and the (as you say) still broken CachePreDMA() and CachePostDMA() functions lead to hell in this case.

In OS3.x AllocVec() was the way to get memory.

In OS4.x this compatibility has been broken for reasons unknown to me, with all bad consequences for hardware and software.

Sorry, from my limited point of view (being a hardware guy) this was a bad decision, as old software cannot be changed, and this software is bound to compatibility.


Michael
amigakit
Published: 2008/5/7 21:58  Updated: 2008/5/7 21:58
Quite a regular
Joined: 12/04/2006
From: www.amigakit.com
Comments: 728
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
We will be stocking Deneb USB card

Full product information here:

http://amigakit.leamancomputing.com/c ... _info.php?products_id=795
joerg
Published: 2008/5/8 1:09  Updated: 2008/5/8 1:09
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

Quote:
Basic problem is that "old" software usually takes AllocVec() or AllocMem() to get buffer memory for DMA, which is not linear in OS4 anymore.
Just like on AmigaOS 2.x and 3.x since over 15 years with a tool like GigaMem or VMM installed. Your wrong assumtion that memory allocated with AllocMem() or AllocVec() is physically contiguous can't be backed up by any official AmigaOS documentation, on the contrary it's obvious that you must not depend on such side effects since it wouldn't have made any sense for CachePreDMA() to not only return the physical addresses but the lengths of the fragments as well if it would have been guaranteed that all memory allocations return physically contiguous memory.

Unlike AmigaOS 2.x and 3.x AmigaOS4 does have a function to allocate physically contiguous memory, but with a m68k driver you can't use it, like all new exec V50+ functions it's only callable from PPC native code.
mboehmer
Published: 2008/5/8 6:49  Updated: 2008/5/8 6:49
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
Unlike AmigaOS 2.x and 3.x AmigaOS4 does have a function to allocate physically contiguous memory, but with a m68k driver you can't use it, like all new exec V50+ functions it's only callable from PPC native code.


Which in turn renders all M68k DMA related stuff *useless* and non-working.

Apparently all programmers doing DMA related stuff did rely on this assumption, as otherwise Zorro III DMA cards would work in AOS4 Classic.

If this "side effect" would have been taken into account when designing the new OS4 memory allocation functions quite some discussions and lot of complaining about non-working DMA would have been avoided.

Why introducing some incompatibility / inconsistency when not absolutely necessary?

Still, we are offtopic again. OS4 DMA is not related to DENEB.

Michael
Crumb
Published: 2008/5/8 13:01  Updated: 2008/5/8 13:01
Just popping in
Joined: 12/11/2006
From:
Comments: 30
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Relax guys... I'm sure some solution to this small problem could be found.

perhaps making an OS4 native driver that uses that special memory allocation functions or changing os4 to reserve a small memory zone with real addresses and not real addresses to use old DMA drivers so old DMA cards work.
rwo
Published: 2008/5/8 17:35  Updated: 2008/5/8 17:35
Not too shy to talk
Joined: 12/01/2006
From: Skærbæk. Denmark
Comments: 304
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

If I wanted to rebuild my old a1200 this card is really a must for me.

Then there is the question about doing an native hw version for Sirion, and I might be intrested in that aswell.

But is it possible to get hold of youre HW specs/docs?

RWO
joerg
Published: 2008/5/8 18:03  Updated: 2008/5/8 18:03
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

Quote:
Which in turn renders all M68k DMA related stuff *useless* and non-working.
Only in case of broken DMA drivers not using Cache(Pre|Post)DMA(), which was always required even if the implementations in AmigaOS 2x./3.x didn't do much unless you install 3rd party tools like GigaMem or VMM, but for example CacheClearE() instead and depending on the wrong assumption that physical address = virtual address.
ssolie
Published: 2008/5/8 20:39  Updated: 2008/5/8 20:39
Amigans Defender
Joined: 11/26/2006
From: Canada
Comments: 986
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@joerg
To me it sounds like mboehmer is depending on an undocumented side effect in his driver and the real solution is to use the Cache(Pre|Post)DMA() functions correctly to obtain access to the DMA areas. The fact it seems to work on AmigaOS 3.x is only a coincidence.

That said, mboehmer does have some ground to stand on in the backwards compatibility arena. What is the harm in changing the 68k accessible version of Alloc(Mem|Vec)() to return contiguous RAM? That way all the broken 68k drivers will work until they can be replaced with properly coded versions or even better PPC native versions. Will this kind of hack break anything else?
TSK
Published: 2008/5/8 22:21  Updated: 2008/5/8 22:21
Just can't stay away
Joined: 02/23/2007
From: Finland, the land of Santa, sauna, sisu and salmiakki
Comments: 1209
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer
So why it must be 68k and why there's not native OS4 drivers ?
joerg
Published: 2008/5/9 1:04  Updated: 2008/5/9 1:04
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@ssolie

Quote:
That said, mboehmer does have some ground to stand on in the backwards compatibility arena.
No, it is (nearly *) 100% backward compatible if the m68k DMA driver is implemented correctly using Cache(Post|Pre)DMA().

*) What isn't, and can't be, compatible is the CPU cache line size. m68k CPUs have 16 bytes cache lines, PPC CPUs 32 bytes. On m68k 16 bytes alignment was enough for DMA, on PPC it's not and using less than 32 bytes can in rare cases cause data corruption (2 successive, 16 bytes aligned buffers used for DMA at the same time).

Quote:
What is the harm in changing the 68k accessible version of Alloc(Mem|Vec)() to return contiguous RAM?
Probably not much, "just" more fragmentation of the physical address space when running m68k software, but it wouldn't change anything and especially wont make broken DMA drivers work. Although I don't know anything about other USB protocols at least for massstorage it's exactely the same as for any other storage drivers (ATA, ATAPI/SCSI, etc.): The driver gets the data pointers from the file systems which may just pass them though from the applications, or the driver gets the data pointers directly from applications like AmiDVD. Neither PPC file systems nor PPC applications use workarounds for broken DMA drivers when allocating memory for device I/O, they just (should) make sure the data is 32 bytes aligned to make using direct DMA in the driver possible. Of course the drivers have to support unaligned data as well, but that's slower as it requires using a correctly aligned buffer in the driver for DMA and copying the data around.
mboehmer
Published: 2008/5/9 10:15  Updated: 2008/5/9 10:15
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
Only in case of broken DMA drivers not using Cache(Pre|Post)DMA()


We are using those functions, and we are using them correctly as far as a hardware guy like me can judge.

Maybe you can explain me what's wrong in our case:

- we get a pointer to a DMA buffer (longword aligned)
- we do the CachePreDMA() stuff
- in case we have one full block we do DMA on the physical address returned from CachePreDMA()
- in case we have fragmented memory we do PIO
- of course, CachePostDMA() follows after the dirty work is done in case of DMA

That's a workaround in some way, but this *should* work. Even with February update, it doesn't, while both DMA and PIO driver work flawlessly under OS3.x

What are we doing wrong in your opinion?

About your opinion of "broken DMA drivers": it's easy to drop backward compatibility and skip support for all DMA stuff on Classic, but not a wise decision.
Especially the A4000T internal SCSI is missing for many people, same for Fastlane.

Michael
mboehmer
Published: 2008/5/9 10:18  Updated: 2008/5/9 10:18
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
So why it must be 68k and why there's not native OS4 drivers ?


Because there's no need to reinvent the wheel again if there's a working JIT with good performance (besides other political issues on MOS and OS4.x).

Anyhow, if someone volunteers to implement a native DENEB driver for the OS4 USB stack, please contact me.
mboehmer
Published: 2008/5/9 10:25  Updated: 2008/5/9 10:25
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
To me it sounds like mboehmer is depending on an undocumented side effect in his driver


No, damnit, we use the Cache/(Pre|Post)DMA() functions as explained in one post here.
And they *fail* even with the February update, which honestly said did improve the situation compared against the initial release version of OS4.

Quote:
... the fact it seems to work on AmigaOS 3.x is only a coincidence.


Ah, really? So you think after two years of development we "just had luck" with DENEB DMA working perfectly and with high performance on Amiga Classic?

Sounds to me like you never did low level stuff in neither hardware nor software.
mboehmer
Published: 2008/5/9 10:27  Updated: 2008/5/9 10:27
Just popping in
Joined: 01/16/2008
From:
Comments: 14
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
No, it is (nearly *) 100% backward compatible if the m68k DMA driver is implemented correctly using Cache(Post|Pre)DMA().


So please show me working M68k DMA drivers for

- Fastlane Z3

- A4091

- internal A4000T SCSI

Why don't they work?
joerg
Published: 2008/5/9 14:53  Updated: 2008/5/9 14:53
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

Quote:
Maybe you can explain me what's wrong in our case:

- we get a pointer to a DMA buffer (longword aligned)
That's not enough, it has to be aligned to the CPU cache line size, on real m68k CPUs 16 bytes, on PPC 32 bytes. For unaligned (address and length) buffers you have to either use an internal, aligned device buffer, DMA to/from that buffer and copy the data around, or for hardware which supports it and for small transfers for which it can be faster than DMA to/from an aligned buffer and memcpy() use PIO instead.

Quote:
- of course, CachePostDMA() follows after the dirty work is done in case of DMA
There has to be a matching CachePostDMA() call for each CachePreDMA() call, no matter if you actually use DMA or not.
Spirantho
Published: 2008/5/9 14:56  Updated: 2008/5/9 14:56
Quite a regular
Joined: 11/27/2006
From:
Comments: 535
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Just to add my own experiences....

I've found limited use of CachePreDMA etc. - whenever I've tried to allocate more than about 2K it'll just fail and return nothing useful. However, I am still using an old version of the SDK (the current version, 51.22) which dates from before the large memory change. Hopefully the new SDK will come out which may help.

On the other hand, if this function is working then the driver should be able to support it. Every other OS supports scatter/gather as far as I know, you need to if you're going to use a proper modern memory system such as the one OS 4 uses.

So while I greatly appreciate the work that E3B have done (and have voted with my wallet, too!), I do think that there is no reason why an OS4 driver shouldn't be written, so hopefully someone with more time than I will volunteer to have a crack at it. I could possibly even have a hack at it myself if necessary but whoever it is will need the SDK supporting the memory system changes which is still not public (the last SDK was 11/Apr/2006).

I think people perhaps need to stop thinking of OS4 as being OS3.9 with bells and whistles - it's not, there's some major changes and modernisations gone on which are necessary - the changing of the memory system was one of them. Hence accusing OS4 of being broken is wrong because it's not, it's just evolved, and the cost of that evolution is that you can't rely on old assumptions.

Is that clear? Probably not! :)
joerg
Published: 2008/5/9 15:03  Updated: 2008/5/9 15:06
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

Quote:
- internal A4000T SCSI

Why don't they work?
No idea why it doesn't work on OS4, I don't have the required hardware for debugging it, but it's not related to DMA, it's something else in scsi.device which fails on OS4. The scsi.device for A4000T and A3000 are based on the same sources with small chip specific parts. The A4000T SCSI chip is DMA-only, but the A3000 one can do PIO as well and even a PIO-only build of the A3000 scsi.device doesn't work on OS4.
joerg
Published: 2008/5/9 15:19  Updated: 2008/5/9 15:19
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1929
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@Spirantho

Quote:
Just to add my own experiences....

I've found limited use of CachePreDMA etc. - whenever I've tried to allocate more than about 2K it'll just fail and return nothing useful.
The Cache(Pre|Post)DMA() functions were broken and only fixed in update of the classic Amiga version of OS4. The OS4 drivers don't use them but the new OS4 functions (Start/EndDMA(), etc.) instead which always worked, therefore it took that long until the bugs in the old functions were found. Since there was no update for the AmigaOne yet after they were fixed the Cache(Pre|Post)DMA() functions are still broken in the public AmigaOne versions of OS4.
ssolie
Published: 2008/5/9 16:57  Updated: 2008/5/9 16:57
Amigans Defender
Joined: 11/26/2006
From: Canada
Comments: 986
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
Quote:
Sounds to me like you never did low level stuff in neither hardware nor software.

I think it is best not assume such things and stick to discussing the ideas being presented so that the driver and/or OS functionality can be fixed.
pjs
Published: 2008/5/10 15:58  Updated: 2008/5/10 15:58
Not too shy to talk
Joined: 12/02/2006
From: VA, USA
Comments: 378
 Re: Zorro II/III DMA USB 2.0 controller for all Zorro cap...
@mboehmer

I hope you can extend your assistance and expertise to anyone
working on native OS4 support of your Deneb card!

I have an A4000 and I would really like a USB card for it, but
I don't intend to buy any more hardware that doesn't work with
our OS4 future.

On the other hand, I WILL vote with my wallet if there will be a
native OS4 driver for your new card.

Thanks for your great work Amiga hardware and I look forward to
OS4 support!

PJS
General
Site sponsors
 
Contact us on discord to advertise here.

Site statistics
Registered members
  1722
Logged in last:
  24 hours, 66
  7 days, 127
  30 days, 188

Random Photo
Commodore Technical Support Notice

New Articles List

New Members
Amigafreak02
Amigafreak02 11/15/2024
Drakken
Drakken 11/14/2024
ybbasepiw
ybbasepiw 11/11/2024
Mr_byte
Mr_byte 11/06/2024
ghettofinger
ghettofinger 10/30/2024
VaultDweller
VaultDweller 10/30/2024
Greenslade
Greenslade 10/11/2024
komyash
komyash 09/20/2024
Correine
Correine 09/16/2024
Falke_34
Falke_34 09/14/2024


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project