Allwinner H3
|
I got it! Of course there’s still a lot to do even with USB, including re-enabling the OHCI ports and trying to work out what the module wants, and whether it can even be provided. But this is good! Now I can make progress again, including the desperately needed early boot things like RAM size detection. |
|
Since the last post I’ve mostly been working on code cleanup. Things are kind of tattered after all the efforts to get things working. Most of the useful headers are now hdr2h compliant, with one major exception. StaticWS. is there any way to deal with “OSentries # 4*(HighestOSEntry+1)”? I’ve enabled a heap of extra modules too. RTSupport actually works now, which is good. The chunk of (U-Boot set?) VRAM near the top of RAM can now actually be mapped in as VRAM in RISCOS_AddRAM without locking the system solid. So that’s done now instead of being mapped as IO. Not that it does anything yet anyway. Michael Grunditz’s threads are a great resource for me. He encountered a lot of the same things I am. I think the main reason I am looking at the Video part of the HAL right now was I was contemplating what has to be done to allow RISCOSMark to run. Most other things fall flat with “File ‘IconSprites’ not found (Error number &D6)”. It’s a bit of a shame, but no big deal. Oh! Only semi-related, but when I got the code to the point where it could boot happily with uImage, a piece of key behaviour was changed somewhere. Just for the sake of it… not all of these function totally because of missing SWIs, but they can load.
e:since that post I’ve added nearly the full complement of modules to the build. It’s helped with random issues because of missing stuff. |
|
My RPi3 that I use for development had a bit of a hiccough last night when the DVI cable got knocked. I eventually got RO not just display a blank screen after booting again, and the pinboard icons came back. But it scared me a little. While I’m backing up the project files, the rest of the source tree isn’t. It has bits and pieces grabbed from CVS and transplanted in So here I am trying to get SVN working again on my “file server”. I’m not fond of Subversion at all. It does however have the interesting advantage of having a RISC OS port which does file / directory tree translation. Last night I was messing around with my AWH3 build of RO with all the extra modules I’ve thrown at it. I believe it’s Schrodinger’s release. I’d love to know if it is running the WIMP. I can issue it *WimpMode commands, of which there are some it doesn’t complain. Also doing some things with a connected USB keyboard yield some odd results.
Given that it boots first time, every time now makes all this way easier. Maybe RTC could be added to that list. Maybe. I’m working on the Orange Pi PC which has a minor design defect where the SoC RTC is connected to one of the voltage rails, so it can’t be battery backed. Other devices probably don’t have this problem, but I have what I have. Personally I’ve just been using a standard RPi IIC RTC on it anyway. |
|
That whole DVI cable issue caused some problems! Some subtle corruption to RO on the Pi that I didn’t notice initially. I haven’t been able to do any real work on the H3 port recently, however I have been trying to work a few things out. An interesting one is the behaviour when I run something from the SVC prompt which apparently requires the Desktop. For example !SetPaths in AcornC/C++.
What I take away from all this is the WIMP is probably running. The slurring could either be multitasking related, or perhaps I need to revisit the UART init code. It’s been well behaved so far, but this makes me wonder if the bootm boot method is disabling the FIFOs. |
|
Beyond extending hdr2h, the cleanest way of dealing it would be to replace it with a constant and an assert, e.g. OSentries # 32 ASSERT ?OSentries = 4*(HighestOSEntry+1) That way it’ll keep hdr2h happy, while still helping to make sure the list is the right size. What appears to happen is a dump of binary data to the terminal and then locking solid. This isn’t the case. In amongst the terminal enraging data there is a clue. Two bits of text. “Use *Desktop to start Filer”, “Cancel”. Today I realised. Using the USB keyboard plugged into the OPiPC, hitting ‘Enter’ more or less results in the dump being repeated. Hitting ‘Escape’ results in the SVC prompt reappearing. That’s probably VDU sequences – the Wimp makes heavy use of them when rendering the desktop. But if the desktop is rendering things, I’m not really sure why Escape should bring you back to the command line. Maybe it fails during initialisation somehow? |
|
I have literally no knowledge of Perl. I have an O’Reilly book which probably pre-dates the version of Perl in the RO build tree, but doing what you suggested seems way more sane. I can’t tell what the binary data is because it hits on terminal control characters more than once and makes a mess, but what you say sounds plausible. I’ve been thinking about the behaviour too, and I have a theory that isn’t based particularly well on facts because I’m unsure of the finer details of system-wide multitasking. Things we know are that the SVC prompt can only be directly interacted with via the UART. The USB keyboard goes elsewhere and interacts with something else. Issuing things like ‘Escape’, ‘Crtl + Break’, and a few others definitely have an effect on something. What I’m thinking about is exactly how system modal a dialog can be. Escape may not exactly be bringing the UART SVC prompt back to the ‘*’, but rather continuing execution so that the code that spat out the data to screen can finish execution and return. Also I can issue some *WimpMode changes successfully. Of course with no visible output, but some are accepted and others are rejected as being unsuitable for the desktop. At this point I’m not even aiming to have a proper interface. It’d be nice, but other HAL stuff needs to be taken care of first. It’s this behaviour which is a source of some confusion for me. Probably worth noting is I still haven’t rebooted it. Using the UART SVC prompt still results in some of that odd slurry-ness, and random little spatters of binary data. Just not the page or two of garbage that attempting to execute some things results in. Currently when I try to run Firebench or ROMark, the complaint seems to be that the desktop resolution isnt’t high enough, which is interesting. I toyed with the idea of a USB ethernet adapter and !VNC too. Trouble is my only USB ethernet adapter is an adapter / USB hub with a MicroUSB connector. The only way I can use that is to get the OTG port on the OPiPC working as a normal USB port. Which brings me back around to implementing GPIO again. Ha. |
|
I’d be inclined to create an sdcard with a fresh harddisc4 image and set it up on another computer – a pi maybe – so that it starts up correctly, runs vnc server at boot and connects using an external usb ethernet adapter – you can get a micro type B female to type A male adapter if you don’t want to buy a new ethernet adapter. Then you can change the boot and rom files for the orange pi version and try it in the orange pi. The ethernet port on the orange pi will need a new ethernet driver written for it. |
|
Hi Colin. I’m kind of functioning on reduced capacity right now, so I’m not sure if this is silly. I have no idea if it “sees” !Boot or anything else by default. What I do know is that when the OPiPC boots it’s parked at the root directory of the USB drive, so it has enough marbles to know it’s there. Given that the OPiPC only has USB and not SD support yet, getting an image working via an RPi may be a touch curly. I know it’s a well trodden path using one media for the ROM and a USB drive for the hard disk, but I’ve never done that before. The ethernet driver doesn’t concern me much. IIRC it’s a common type, but I have no idea how it’s actually connected up to RISC OS. If I knew that, I would have tried to get the SPI ethernet adapter I have working in RO on the Pi Zero. I actually used to use in on my old Pi Zero in Linux. Meant for Microcontrollers, but an adapter is an adapter. |
|
The USB ethernet thing arrived yesterday. Should be interesting to see what happens when I test it. Been hung up on writing the (G)PIO code. It’s not even hard. I can see it. Just got a mental block. It is clear to me that I need to get it written before proceeding. It controls a lot of internal and external IO functionality. |
|
The ethernet thing was a waste of money. It uses some weird chipset. It has however prompted me to start work on getting the USB host functionality of the OTG port working. It seems to be done, minus supplying power via a PIO register. It appears as a port, so that’s good. |
|
I have read through this thread and found a lot of it confusing which has lead me to the conclusion that I (a) need to read more and (b) I need to re-evaluate my desire to start a porting effort until (a) has been thoroughly completed! On topic question: How stable/far along is the port to the H3? Somehwat off topic question: How much of this effort could be re-used/re-directed to a port to the Allwinner A64? (which is my desired target…once I’ve properly read all there is to read…might take a while…) |
|
Hi Glen. Where I’m at: What works to some degree. What doesn’t work / isn’t implemented. What I’m working on currently is the PIO module. It’s a gateway to configuring a lot of the hardware. I really wanted to keep all the code for touching the main PIO ports in one place. As for stability, I can leave it running for days and come back to it. It’s always just as I left it. Now, as for the A64… That’s a fun question you asked. Some of the things I haven’t coded yet I’ve been avoiding doing because the way I do it would depend on whether a ROM image can be used for both the 32 and 64 bit incarnations. The big “IF”, is if there is a way of making U-Boot for the aarch64 platforms start a uImage in 32 bit mode. All that aside, if it could be dropped into aarch32 bit mode then it should be pretty easy. I just had a look at the H3 and A64 memory maps side by side. Some of the SRAM, BROM, and I think the CoreSight Debug are in different locations. Just about everything else are in the same location and are essentially the same. |
|
Thanks for the update and I’m encouraged by the prospect/potential of being able to port to the A64 after the H3! Will keep my beady eye on the forum from time to time…but otherwise good luck and hope you get better soon! |
|
Thanks. I got sick with three different bugs that were going around concurrently. It was pretty unpleasant. Still trying to shake the lingering after effects. I keep getting myself all tangled up with the PIO code for some reason, so I’m working on a new C "pseudo"code version. It stops me from trying to be clever. While I’m here… Let’s say I actually tried to use this C code. It only needs one entry from StaticWS. If I were to give the PIO code an init function which takes the PIO logical base address as a static uint32_t or whatever, would it actually persist? I made this quick list for another forum. These are the documents which I reference for the H3. Putting these names here for myself or anyone else that wants to know.
Really off topic, but I temporarily bricked my phone and my tablet while trying to find a way to use the RO linux port so I could actually work on this more often. My netbook can run RPCEmu at a whopping 9MIPS, so I’d rather just not even try that again. It can’t run the Linux port (which would have been slow anyway) because something to do with the port is unable to allocate memory. No idea. Going back a step here. Both the H3 and H5 are quite good at running the RO Linux port, although the Linux2 branch is a monumental headache to build. |
|
DE 2.0 … good luck! |
|
Thanks. It’s not something I’ve been looking forward to. I think I lost a few brain cells when I got sick. I’ve forgotten how to do some really simple stuff. Working back through it though. I’ve also been attempting to work on some rudimentary RAM detection. I know what I want to do, but again, need to revisit basics. I’ve been avoiding doing the RAM detection for too long. So now I’m doing it to avoid finishing the PIO code. |
|
Recently I’ve been through hell trying to use every bit of hardware I can dig up as a means of working on this while not at my computer desk. So many failures. So much time wasted. My Netbook just can’t seem to handle RO Linux. It just gives a mysterious “Unable to allocate memory” error. I think I mentioned I bricked my old ASUS TF700T trying to get Linux working on it. I got it working again eventually. Never trying that again though. Dug out the crusty old Toshiba Satellite. Had to do a strip and rebuild to fix a dislodged power jack. Nothing. It’s just dead. Dug real deep and found the eee701. I don’t think it had been powered up since about 2010. More wasted time. Dismantled a 386 laptop in desperation to see if I could find a datasheet for the LCD to do a DIY Pi Top of sorts. Datasheet I found was for a similar model but it had the wrong number of pads on the LCD, so no. Even if I could pull off that miracle, I’d still have the no trackpad issue. In the process I also learned that RO Linux breaks when trying to use it via XRDP. It can be made to run via X tunnelling over ssh but it can’t accept any inputs. I know this isn’t really on topic, but I’ve been trying multiple ways to be able to work on it more readily. It’s been really getting to me! |
|
No working x86 laptops at your disposal that could run RPCEmu? |
|
I wonder, why is RAM detection so important and why is PIO? It is much more fun working on a port when you get it to a usable state. Since you have USB I suggest that you start with the display. There is a NetBSD port? In that case look on that implementation, I am pretty sure they have found a sneak way. Otherwise dump out DE registers from linux or from u-boot (if that has display support). Read in those values in riscos, and crosscheck the DE 2.0 manual. |
|
My netbook can “run” RPCEmu. It’s only really any good as a study in patience and observation of the draw order of RISC OS. TBQH my cycle for years has been to try to use the netbook, get frustrated, and put it away again. There’s just something inherently rubbish about it. Using it to do a ROM build is kind of impractical. I can start it off in the evening and it’s still going the next day. About the only combination of RO Linux and RPCEmu on a device I haven’t tried yet is either on the Eee701. My best chance is to set up a Linux install on an SD card for that. I don’t see 4GiB internal being enough for everything I need to get it up and running.Yes, the Eee is older and technically lower spec’d, but my old Acer has always been ponderous compared to the Eee for reasons I’ve never pinpointed. I’ve also tried VNC. It works, but it’s of limited use to me. I used it to make some quick revisions to the RAM detection code recently. However it requires me to have uninterrupted access to the local network, and to have a Pi and VNC up and running beforehand. I may seem defeatist. However these are the end results of an appalling number of hours spent trying to find a solution to accessing a build environment away from the desktop. Michael. RAM detection would be nice. I have three Allwinner based devices here, all with different amounts of RAM. There are heaps of devices out there using similar chipsets using between 256MiB and 2GiB RAM. It’d be nice to make it more available. The PIO is more than just GPIO. I’d consider GPIO to be a subset of the PIO pads which have been broken out to the header connector. The PIO ports are one of the areas responsible for board control. There are a couple of bits of code where I’ve hardcoded in control of some of the registers to get things working, but that was just a means to an end. I think I said it in the previous post, but the lack of time at the desk is the biggest issue I’m facing. A lot of the coding is exploratory. I go through so many completely different versions of code poking at the hardware trying to find what tickles it in the right way. It’s a rapid cycle of code, build, run, analyse, repeat. Changing the subject a little. A while back I received the USB A to MicroUSB adaptor so I could test the LAN adaptor / USB hub that I use for the Pi Zero on the OPiPC without modification. The results were promising but not successful. RO on the OPiPC could see the device and tell me what it is. The USB ports worked. It could identify the LAN adaptor. However I couldn’t work out how to talk to it / test it via CLI. While I’m here, I want to know if it’s possible to sanitise an RO source tree so it can be uploaded? I would really like to shove a copy of my tree on to GitHub minus non-distributable DDE stuff. Removing the other things is easy. I just don’t know the extent of what happens with bits from the DDE toolchain. My source has an odd mix of modules pulled from different targets trees. Not something I want to reconstruct in a hurry. |
|
Remember that if you’re planning to run it on ARM devices (or any other non-x86), performance will be pretty poor due to lack of recompiler support.
I think the process would be:
I.e. you should just be left with the folders for the different licenses, Prepare, and Products. If in doubt you could take a known-clean source tree, perform a build using it, clean it up, and then diff against the original archive. |
|
Only tangentially related but I feel others may benefit, or myself the next time I forget.
|
|
Apparently the NES Classic Edition has an a7 based Allwinner SoC at it’s heart.
I gave this some thought and this is what I am doing. I’m just working on writing the code to set the PHY up. Nothing exciting. It’s mostly just a magic incantation of setting bits on registers and timed pauses which developers had to pull from the Sunxi BSP code. edit: There is a document for the PHY. I have it now. Only really has what the source has, plus some extra register names, and minus a couple of magical registers. |
|
I’ve been plagued with issues preventing me from working on this. Just been doing it in little bots occasionally. The loading module count went up from 89 to 119 today. I found some odd build artefacts in the tree that I cleaned out that were preventing a7 objects from being built. The troublesome FSLock finally got built. For some reason it just needed more RAM allocated to let it build. Only one negative effect has been observed. For some reason I can no longer build FPEmulator. It broke about the same time I got SystemDevices to build. Although the OPiPC is booting via network using tftp from U-Boot and communicating with me via serial cable, it now appears to be using the OS I put on a FileCore formatted USB drive and I believe it is using !Boot Recently I had a failed attempt at video output. I overlooked something which meant a lot of wasted effort and what amounts to a lot of useless code that needs to be pruned out. However I did see some positive results with trying to init the HDMI PHY finally. Although that may never be needed it’s nice to see that I’ve finally worked out how to talk to it. This means I can get to the DWC video controller. |
|
I found even more documents. I’m probably missing something obvious but for the life of me I can’t work out how to point the video hardware to the base address of the framebuffer, or anywhere for that matter. It’s the one thing I can’t seem to find. E: Found what I was after on another “Island” Wiki page via Google. |