Cypress EZ-Host Firmware Development Under Linux.

Progress has been slow, because I have been otherwise occupied for quite some time.  Slow, but not entirely still.

Since turning Loper OS into an ab initio CPU architecture project, I have been using Xilinx development boards for prototyping.  For the past year ---  an ML-501.  The FPGA toolchain itself is (grudgingly) Linux-friendly, but those for many of the I/O chips included with the board are anything but.

For instance, on the ML-501 (and a few other Xilinx boards) there is a Cypress Semiconductor CY7C67300 "EZ-Host Programmable Embedded USB Host and Peripheral Controller."  Sounds useful, no?  The free SDK includes a few code examples.  Cypress also distributes an assembler, "QTASM.EXE" (included with the EZ-Host BIOS source code.)  The assembler is Windows-only but will run happily under Wine.  And it would not be too difficult to write your own assembler for this very simple and decently-documented chip.

The Cypress EZ-Host (also called EZ-OTG) should not be confused with the commonplace Cypress EZ-USB chip!  This is a rather different architecture.  None of the EZ-USB tools will work.

Know that the EZ-Host SDK is a cruel kick in the face to a Linux user, because Cypress's firmware-uploader and memory-dumper tool ("QTUI2C.EXE") will not run under Wine.  Nor is any source for the tool available.

Imagine there were a construction company which expected carpenters to cut wood only with pocket knives!  Vendors who expect embedded firmware developers to use MS-Windows are just the same.  But odder still are vendors whose SDK is a mix of the reasonably Linux-friendly and the purely MS-bound.  That is quite like mandating pocket knife-only sawing on even-numbered days of the calendar.  (One less-than-shocking example of this: Intel.  And, well, Cypress.)

But, my fellow Xilinx and Cypress sufferers!  The hour of liberation has come! I have written EZOTGDBG, a quick, rough replacement for QTUI2C.EXE. The sole dependency is libusb-1.0. The license is GPL-3.  Friends, please test EZOTGDBG on your boards!   But all normal caveats apply!  In particular, your system will release magic blue smoke under the right circumstances if you don't know what you are doing (or are merely unlucky.)  But if you own one of these toys you ought to have known that already.

All bug reports / hate mail / etc. for EZOTGDBG should only be submitted as comments to this post.

So what does any of this have to do with Loper?

The USB controller in question will eventually be used for the obvious purpose: as a USB host on which to hang traditional peripherals (keyboards, mice, disks, etc.)  But at that point, there will be no need to flash its firmware from the "mother ship."

But right now the 67300 sits on "ShortBus", the Loper prototype machine's rough analogue to the original Lisp Machine's "Spy Bus." The basic idea here is to inspect/manipulate state under remote control.

And so, something like EZOTGDBG is needed, to initialize the controller when Loper cannot yet be relied upon to do so.

Writing programs like this is a misery, but it cannot be entirely avoided if the kind of thing I have in mind is to go forward.

This entry was written by Stanislav , posted on Friday January 20 2012 , filed under Cold Air, FPGA, Hardware, LoperOS, Progress, Reversing . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

20 Responses to “Cypress EZ-Host Firmware Development Under Linux.”

  • Chris Smith says:

    Thank you for your efforts. It is always good to see hardware platform-liberated, albeit painfully, especially with the noble cause of _proper_ progress.

  • Kuvol says:

    this is very cool

  • Duncan Bayne says:

    Nice work, great to see progress being made! 🙂

  • M says:

    And what happens if you finish this? You post instructions for other people to maybe buy their own hardware and follow the steps to build their own psuedo-Lisp Machine? Who will follow them?

    http://www.loper-os.org/?p=46 had a comment that detailed a workable plan for a Loper that people might actually use. More concretely, Clojure is an "unacceptable Lisp" but it's a Lisp people might actually use, and decoupling your romantic notions of Lisp from reality may serve a useful purpose, namely recruiting others to help you in your cause and contribute insight and code.

    Playing around with rare hardware ensures that as close to no one as is physically possible will ever experience what Loper OS has to offer.

    I've been following this blog for a long time and I would really love to see what you have to offer. Intelligence amplification/augmentation has been an interest of mine for quite some time now, and I wish it got as most attention as artificial intelligence. Custom hardware doesn't serve this cause, though.

    What is it about Loper that requires such low level considerations? What is it about Loper that you couldn't implement in HTML or OpenGL?

    • Stanislav says:

      Dear M,

      > And what happens if you finish this? You post instructions for other people to maybe buy their own hardware and follow the steps to build their own psuedo-Lisp Machine? Who will follow them?

      I happen to think that there are people who would be interested in obtaining a sanely-designed personal computer. Even if this requires - horror of horrors - spending a week's pay on it.

      > ...a Loper that people might actually use. ....Clojure... it’s a Lisp people might actually use, and decoupling your romantic notions of Lisp from reality may serve a useful purpose...

      You claim to have been "following this blog for a long time," but have you actually taken the trouble to read any of my posts? Did you read "What they build, works!", "Shards of Lost Technology", "You have made your bedrock, now lie in it" ? Or perhaps the word "follow" means something else these days - something rather shallow and Twitterine; perhaps it refers merely to the act of rolling one's eyeballs over a heap of text while searching for familiar catch-phrases and grunts of approval. Actually reading what you "read" is so yesterday, right?

      > ...recruiting others to help you in your cause
      and contribute insight and code.

      Plenty of people have contributed insight to my project. I have never met or corresponded with most of them. But have you heard of the wonderful invention called a printing press? Just one hunk of dead tree can be worth more than the whole puerile "coder community" put together.

      And what makes you think that I would like others to contribute code here? I am trying to create something genuinely original. (I am not sure if this concept actually maps to anything in your mind - it doesn't in most people's.) This means that I might be, purely theoretically, able to make use of the help of only a very small number of people - and then, only in strictly-subordinate roles. As this is not a funded, commercial project, I have no subordinates. Were you taught that no substantial technical work can be carried out by just one person? You were taught lies. Open a book, you will find yourself pleasantly surprised.

      > Playing around with rare hardware ensures that as close to no one as is physically possible will ever experience what Loper OS has to offer.

      Are you a homeless and penniless vagrant? I somehow doubt it - where did you get the computer you are posting from? If you wouldn't spend a week's pay on a sanely-designed computer, a true intelligence-amplifier, I cannot fault you. Perhaps you have other priorities. But there are others who will.

      I can't help but wonder if the abysmal experience of modern computing is not entirely unconnected with the fact that everyone has come to believe that being asked to pay real money for one's tools is unreasonable. Do you own a car? What did you pay for it? Why do you suppose that a serious person living a life of the mind ought not to pay at least a small fraction of that sum for the tool of his trade, for his electronic extension of eye, ear, and memory?

      > I’ve been following this blog for a long time and I would really love to see what you have to offer. Intelligence amplification/augmentation has been an interest of mine for quite some time now, and I wish it got as most attention as artificial intelligence. Custom hardware doesn’t serve this cause, though.

      You know quite well what I have to offer. But it would appear that you wish for me to offer something rather different. I am afraid that I must disappoint you.

      Custom hardware is the only thing that serves this cause. There is no "software crisis," there is only the idiotic clunkiness of the Von Neumann approach. Hardware architecture is not irrelevant, and it cannot ever be fully abstracted away. It took me a number of years of continuously bashing my head against the swamp of modern computing to realize this. If you disagree with my conclusion, why are you visiting this site? What do you hope to learn here?

      If you will not listen to an unknown, perhaps it would interest you to learn that no less a person than Alan Kay wrote: "People who are really serious about software should make their own hardware." What do you suppose led him to say these words? Did he perhaps have some actual experience testing his genuinely-original ideas on a variety of hardware architectures?

      I program traditional computers for a living - it is an easy and fairly lucrative trade for any thinking person. But in my personal life, I deliberately stand apart from "programming culture." Because it is an idiotic circus. I think that massively-collaborative software development is a crock of shit. (When do we get massively-collaborative novel-writing? Painting? I can hardly wait.) And I think that the X86 machine architecture is also a crock of shit. It is not a viable foundation for a truly comprehensible, programmable, and well-behaved intelligence amplifier. If you believe otherwise, you are welcome to prove me wrong by carrying out my original project (x86-64 Lisp-based OS) yourself. Write a sane operating system for the PC! But expect no help from me. I regard the years of my life which I spent laboring under that misconception as mostly wasted.

      Pray tell: why do you return to this site? Nothing I wrote appears to have made any imprint upon your mind. And what do you wish to see created, which is truly new? Why are you not content with simply running Linux? Or even Windows? With your beloved, popular development environments (e.g. Clojure) running on top?

      > What is it about Loper that requires such low level considerations? What is it about Loper that you couldn’t implement in HTML or OpenGL?

      Here I must let Charles Babbage speak for me:

      "I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."

      I don't know what you meant when you said that you have been "following this blog for a long time," but it clearly did not involve reading my posts or thinking about their contents. I beg you, please find another! There is plenty of Internet to choose from.

      Yours,
      -Stanislav

      • Kuvol says:

        Will it be hard to make firefox (or something functionally equivalent) work in loper os?

        • Stanislav says:

          Dear Kuvol,

          There will be a working WWW browser.

          Yours,
          -Stanislav

          • Kuvol says:

            Dear Stanislav,
            I should have been clearer: Do you imagine the browser more like firefox on osx or w3 on emacs? Will there be html5?
            Yours,
            -Kuvol

            • Stanislav says:

              Dear Kuvol,

              This is a rather odd question about an OS which may or may not be completed in the current decade.

              Yours,
              -Stanislav

              • Kuvol says:

                Dear Stanislav,
                I was just thinking: If you want to scrap everything related to Unix, it will, presumably, be hard or impossible to port apps. This won't be a big deal for early adopters *if* they have working modern browser with which they can do 90% of day to day computer stuff online, in web apps. So, assuming it *is* easier to make a new kind of OS (and it's exotic hardware) work with web apps than with Unix apps in general it seems like this is a better decade for diversity in the OS space than the last one. But is it?
                Yours,
                -Kuvol

                • Chris Smith says:

                  I'm not sure I'd want to actually see the world wide web implemented myself. Having spent the last 15 years building bits of it, I can only conclude that it is another crock of shit that needs to go away. You'd be dragging the whole HTML, SVG and JavaScript mess on top of an elegant platform. It's effectively a platform on a platform. I'd rather not have turtles all the way down. Popularity doesn't mean correctness or usability.

                  There are definitely better ways to do things. From the recent posts on here about HyperCard, I can envision some higher level distributed interactive systems which leverage the native environment rather than abstract it away to insignificance.

                  • Stanislav says:

                    Dear Chris Smith,

                    > I can only conclude that it is another crock of shit that needs to go away. You’d be dragging the whole HTML, SVG and JavaScript mess on top of an elegant platform.

                    I agree with you entirely. And I have conceived of a sane replacement for the World Wide Web, based along the lines you hinted at. See this.

                    I wrote that "there will be a working WWW browser," but there will also be a working GameBoy emulator. And for the same reason. I am quite certain that at least one future user of Loper will yield to the temptation of writing one.

                    My ultimate plan is to erase the distinction between locally installed "apps" and what we think of as network-residing "sites." So, quite possibly one Loper "page" (written by some other person) will be functionally-equivalent to a present-day WWW browser.

                    Yours,
                    -Stanislav

                • Stanislav says:

                  Dear Kuvol,

                  It will be quite impossible to port (in the usual sense of that word) existing apps.

                  Yours,
                  -Stanislav

  • Cosman246 says:

    Out of curiosity, which Lisp dialect will be the primary language for hacking Loper OS?

    --Yash

  • Kuvol says:

    This is probably a stupid question. I'm not into programming per se, but I'm it seems clear to me that tools like emacs org mode, srs software and scripting can make us smarter and more effective right now, and that better software could increase their effect by orders of magnitude. Abstractions inherent in writing systems, calendars, measures of time, math, archiving science, accounting and legal systems changed the way humans thought and interacted in fundamental ways. An OS that is much more than a simulated typewriter, accounting book, magazine reader, tv, mailbox, facebook machine etc. etc. could be just as revolutionary as the printing press was.

    http://en.wikipedia.org/wiki/Socially_distributed_cognition

  • Cosman246 says:

    Ooh.

    If the name is still up for grabs, I suggest EtaLisp (HLisp, .hl)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" highlight="">


MANDATORY: Please prove that you are human:

41 xor 63 = ?

What is the serial baud rate of the FG device ?


Answer the riddle correctly before clicking "Submit", or comment will NOT appear! Not in moderation queue, NOWHERE!