Unofficial Hacker News client - receive Push Notifications on replies.

Show HN: RK3588 QEMU emulator running unmodified Armbian images (opens external site)

60 points by petabyt 1 day ago | github.com | 33 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (12)

  1. Yeah but can it run the DDR training blobs? Do that and I'll really be impressed.

    edit

    > Get the proprietary DDR image working

    Wow, shit did you really do this? Or are you simply ignoring the DDR image's writes and feeding it plausible-enough values that it believes "the DDR is trained" and proceeds to the next stage?

    Actually emulating the DDR controller would be impressive.

    The DDR controller is from Synopsys; most of their DDR controllers are in fact a tiny ARC core (different instruction set). Are you emulating that thing too?

    edit

    > The current test proves that the image returns success with synthetic controller and PHY responses, not that real DDR training is emulated

    Ah, so it's just feeding the DDR training blob whatever values it has to in order to get it to move on to the next step. Too bad. Having a real model of the DDR controller would make it straightforward to write one that's open source... making rk3588 the newest blobless CPU by a large margin.

    Replies (4)
    1. > Having a real model of the DDR controller would make it straightforward to write one that's open source

      With all the link training stuff you leave the easy-to-emulate sphere and go into the RF black magic sphere where digital logic meets physical and legal (EMI compliance) limits. And on top of that you'll have to deal with physical effects relating to the specific manufacture process of both the chip, the packaging and the board layouts.

      AI will not be a help for this for a long time to come, a lot of this stuff can't even be simulated accurately but is essentially an iteration process until something eventually produces high enough yields. And no, just pointing an algorithm at a chip and telling it to "make it work, make no mistakes" isn't sufficient - there's a significant chance the algorithm will just make something uniquely tuned to the very specific instance of the chip and its surroundings like that research team in 2007 [1].

      [1] https://www.damninteresting.com/on-the-origin-of-circuits/

      Replies (2)
      1. There's a middle ground that I think the parent poster is suggesting, where someone could LLM-launder the proprietary blob and documentation; basically, feed the imem/dmem images for the ARC core along with any "obtained" documentation into an LLM and have it write a fudged emulator for the various physical-layer peripherals which the ARC core manipulates to perform training. Then, use that laundered emulator as an oracle to write an "open-source" (for some definition) version of the ARC firmware. That is to say: you don't need to emulate the actual PHYs and RF stuff, you just need to emulate the register states that appear as results in various training states.

        I believe this has been done for Tegra and a few other SoCs even pre-LLM using "traditional" RE, both "cleaned" and "dirty" (ie - some where one person read the disassembly for training and re-implemented it, and others where someone produced documentation in the middle).

        Replies (2)
        1. rkbin blob for rk3588 doesn't deal with any ARC firmware. And RK3588 TRM has about 500 pages of documentation for the controller. ;)
        2. where someone could LLM-launder the proprietary blob and documentation

          To be clear, it's not laundering if you have one LLM look at the binary and write a spec, and the other LLM works only with the spec, and the spec isn't code.

          There is decades of court precedent and an entire industry (PCs) behind this.

          Replies (1)
          1. Laundering - as in, it makes it clean - I suppose I was using the term too casually, but we agree :)
      2. essentially an iteration process until something eventually produces high enough yields.

        AI can definitely help with that.

        Yes, you need to provide it a large testfarm of boards.

        Maybe one a few with an oscilloscope hooked up to a clock and DQ pin. And remote access to the scope of course.

        But it's great at banging its head against the wall until it works.

    2. seems like weirdly specific complaint. You'd only need that if you wanted to develop your own DDR training routine and for that you can just get a board with the chip and try it there...
      Replies (1)
      1. The DDR training blob is the weirdly specific only non-open-source blob you need to run an RK3588.
    3. I tried to get frontier LLMs to do a more faithful DDR training emulation but they really struggled. I'd be interested in trying to push on it harder to create some extended DRAM controller docs and possibly hand write an open source training image
    4. I have and use an opensource DDR training code for all rockchip SoCs I own, from RV1103/6 to RK3588.

      Rockchip uses various third party, often Synopsis controllers combined with third party PHYs, often times from Innosilicon, and on some SoCs their own PHY designs (or some modified third-party design). RK3399 used Denali controller from Cadence.

      Anyway, emulating the controller is not needed, since QEMU is not emulating DDR bus access when guest is accessing memory. :) If you want to boot from boot rom image, through ddrbin, etc, all you need is to emulate enough to not end up locked in some wait loop in the ddrbin blob.

      Replies (1)
      1. I have and use an opensource DDR training code for all rockchip SoCs I own, from RV1103/6 to RK3588.

        I can haz?