IOBarrier 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. README on the IOBARRIER for CardEngine IO
  2. =========================================
  3. Due to an unfortunate oversight when the Card Engines were designed,
  4. the signals that control access to some peripherals, most notably the
  5. SMC91C9111 ethernet controller, are not properly handled.
  6. The symptom is that some back to back IO with the peripheral returns
  7. unreliable data. With the SMC chip, you'll see errors about the bank
  8. register being 'screwed'.
  9. The cause is that the AEN signal to the SMC chip does not transition
  10. for every memory access. It is driven through the CPLD from the CS7
  11. line of the CPU's static memory controller which is optimized to
  12. eliminate unnecessary transitions. Yet, the SMC requires a transition
  13. for every write access. The Sharp website has more information about
  14. the effect this power-conserving feature has on peripheral
  15. interfacing.
  16. The solution is to follow every write access to the SMC chip with an
  17. access to another memory region that will force the CPU to release the
  18. chip select line. It is important to guarantee that this access
  19. forces the CPU off-chip. We map a page of SDRAM as if it were an
  20. uncacheable IO device and read from it after every SMC IO write
  21. operation.
  22. SMC IO
  23. BARRIER IO
  24. Only this sequence is important. It does not matter that there is no
  25. BARRIER IO before the access to the SMC chip because the AEN latch
  26. only needs occurs after the SMC IO write cycle. The routines that
  27. implement this work-around make an additional concession which is to
  28. disable interrupts during the IO sequence. Other hardware devices
  29. (the LogicPD CPLD) have registers in the same physical memory
  30. region as the SMC chip. An interrupt might allow an access to one of
  31. those registers while SMC IO is being performed.
  32. You might be tempted to think that we have to access another device
  33. attached to the static memory controller, but the empirical evidence
  34. indicates that this is not so. Mapping 0x00000000 (flash) and
  35. 0xc0000000 (SDRAM) appear to have the same effect. Using SDRAM seems
  36. to be faster. Choosing to access an undecoded memory region is not
  37. desirable as there is no way to know how that chip select will be used
  38. in the future.