Skip to content
Snippets Groups Projects

Device htc vision

Merged Imported Administrator requested to merge device-htc-vision into master

Hi,

This is a merge request to add support for the HTC Desire Z, aka HTC G2, aka HTC Vision. It's based on the device-htc-vision branch that cmdrwgls created around a year ago. I've added the following changes:

  • make pmbootstrap kconfig check pass
  • enable CONFIG_MSM_KSGL
  • enable compilation with GCC 8
  • add deviceinfo_flash_offset_base to deviceinfo as apparently that is required for HTC devices (#145 (closed))

Unfortunately it still won't boot. When I try (pmbootstap flasher boot), the device simply gets stuck displaying a green htc logo on a white background. I've tried the maximum-attention initramfs hook, but without success, it doesn't even seem to get that far. One possible person to contact might be milaq since he is providing current LineageOS builds for this device and is apparently able to produce a working kernel image from that source tree. And if anybody has an idea about how to make this thing boot I'm all ears! Or if you can give some hint on how to troubleshoot this, I'd also be very interested. Note that I've also tried building this tree with GCC 6 and ended up with the exact same result.

//EDIT: I managed to get the device to boot, this should now be ready to merge.

Edited by Administrator

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator changed the description · Imported

    changed the description

    By Matthias Berndt on 2019-01-05T01:01:27

  • Administrator added 1 commit · Imported

    added 1 commit

    • bd328d7b - htc-vision: add postmarketos-base dependency to make CI pass

    Compare with previous version

    By Matthias Berndt on 2019-01-05T01:48:24

  • Author Owner

    Have you ever tried to start a known working kernel with fastboot boot?
    What about if you flash it into the device?

    PS: added WIP to the title because it's not booting

    By Daniele Debernardi on 2019-01-05T01:58:01

    Edited by Administrator
  • Administrator marked as a Work In Progress · Imported

    marked as a Work In Progress

    By Daniele Debernardi on 2019-01-05T01:57:26

  • Administrator added 1 commit · Imported

    added 1 commit

    • d3867d6f - htc-vision: change arch to armhf in device-htc-vision/APKBUILD

    Compare with previous version

    By Matthias Berndt on 2019-01-05T02:03:41

  • Administrator added 1 commit · Imported

    added 1 commit

    • c1303402 - htc-vision: add !archcheck in device-htc-vision/APKBUILD

    Compare with previous version

    By Matthias Berndt on 2019-01-05T02:07:06

  • Author Owner

    Hey @drebrez,

    I can launch e. g. TWRP recovery through fastboot boot, so yeah, starting kernels does work. Flashing the kernel I built (using pmbootstrap flasher flash_kernel) leads to the exact same result as launching it through pmbootstrap flasher boot.

    By Matthias Berndt on 2019-01-05T11:52:12

  • Author Owner

    I've tried extracting the kernel zImage from a known-working ROM (https://milaq.net/downloads/android/vision/cm-11.0/lineage-11-20190101-NIGHTLY-MLQ-vision.zip) and booting it with the postmarketOS initramfs. This causes the screen to go black after a few seconds, unlike my own kernel images, where it would display the htc logo indefinitely. However the maximum-attention hook still won't do anything, so I'm not sure what to make of this.

    By Matthias Berndt on 2019-01-05T13:45:39

  • Author Owner

    EDIT: I was wrong with this, see below.

    I fear that I have bad news for you. This reminded me a lot of the HTC wildfire port thread, in which the author feinerer figured out that postmarketOS won't boot on the device because it does not have an FPU. Reading it again, I found:

    but pmbootstrap flasher boot shows after upload only a HTC Logo.

    further down in the thread:

    I think I have found out why the device does not (and cannot) boot:

    The architecture armhf in pmOS is ARMv6 but has a strict requirement on an FPU (i.e., requires VFP). However, as it appears, the HTC Wildfire (with its MSM7225 SoC) does not have an FPU despite having an ARM11 (= ARMv6) processor.

    So it looks like due to the lack of a matching architecture (in Alpine and pmOS) this device cannot be supported.

    The HTC Desire Z has the similar MSM7230 SoC (gsmarena). To be honest, I don't know where one would look up if the FPU is present in that SoC or not, bot judging from the similar SoC name and the symptoms, it seems that your device does not have a FPU either, and therefore won't boot. :frowning2:

    It's sad, because that little keyboard device looks really cool, and it would have made a good candidate for postmarketOS.

    If you would like to put a lot of effort into this, you could compile Alpine for armv6 without FPU (at least the needed packages), then add this architecture to pmbootstrap as described here and then finally boot postmarketOS on your device. But I'm sure that Alpine wouldn't have a use for such an architecture, so you/we would need to maintain this port of Alpine on our own, and all in all it does not really seem feasible at this point, beyond a proof of concept for yourself.

    Can somebody find a source stating that the SoC has no FPU? Then we could add this to the wiki page at least.

    Thanks for all the effort you have put into this @mberndt!

    By Oliver Smith on 2019-01-07T07:52:43

    Edited by Administrator
  • Administrator mentioned in commit wiki@909d29a0 · Imported

    mentioned in commit wiki@909d29a0

    By postmarketOS Wiki bot on 2019-01-06T11:42:40

  • Author Owner

    @ollieparanoid: The device does have an FP unit. This wiki page links to this page where it says that hardware fp support is known as vfp on ARMv7 devices. So I checked:

    shell@vision:/ $ cat /proc/cpuinfo
    Processor       : ARMv7 Processor rev 1 (v7l)
    BogoMIPS        : 163.57
    Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
    CPU implementer : 0x51
    CPU architecture: 7
    CPU variant     : 0x1
    CPU part        : 0x00f
    CPU revision    : 1
    
    Hardware        : vision
    Revision        : 0080
    EngineerID      : 0004
    Serial          : 0000000000000000
    

    So that doesn't seem to be the problem.

    By Matthias Berndt on 2019-01-06T12:48:34

    Edited by Administrator
  • Author Owner

    Ok, I'd like to summarize here what I've learned over the course of the last day or so, just so it's recorded somewhere – maybe it'll help somebody to get this guy running.

    The first is that milaq's kernel source tree is very probably capable of producing a working kernel image. I know this because the LineageOS ROM that I linked to earlier is able to boot and contains an About screen that tells me the git sha of the kernel that is being used, and it matches the HEAD of milaq's htc-vision kernel git repo. Unfortunately milaq didn't respond to my email regarding this.

    The second is that the kernel image contained in the LineageOS boot.img is able to run postmarketOS binaries. I checked this by modifying a postmarketOS initramfs (gunzip and un-cpio the initramfs, edit the init script and remove everything not strictly necessary to mount /sys, add a line to trigger the vibrator (echo 10000 > /sys/class/timed_output/vibrator/enable), cpio (with -c flag), gzip, build a boot.img with abootimg) and booting it with the LineageOS kernel image and lo and behold, it vibrated. Sadly it doesn't do that with the kernel image that I built.

    The third is that a boot.img built from the LineageOS kernel image and the unmodified postmarketOS initramfs with the maximum-attention hook will not make the device vibrate or blink. What this tells me is that the maximum-attention hook is not run at the earliest time where that would be possible, which makes it less useful than it could be – after all, everything that is done before that hook is run is just one more thing that can go wrong and potentially prevent the hook from running.

    Unfortunately, I haven't made any progress producing a working kernel image, and I have no more ideas on how to proceed, so I'm giving up for now. I suggest you merge my work into a feature branch in case somebody else wants to pick it up – it is a bit more up to date, compiles with gcc8 and the deviceinfo is more correct (e. g. it will now produce a boot.img).

    By Matthias Berndt on 2019-01-06T19:30:22

  • Author Owner

    Have you tried booting the kernel when compiled with gcc 6?

    By Luca Weiss on 2019-01-06T21:56:02

  • Author Owner

    @mberndt about executing the maximum-attention hook earlier, this can be the solution => pmbootstrap#1607 (closed)

    By Daniele Debernardi on 2019-01-06T22:31:17

  • Author Owner

    @z3ntu yes, that doesn't work.

    By Matthias Berndt on 2019-01-06T22:58:14

  • Author Owner

    The device does have an FP unit. This wiki page links to this page where it says that hardware fp support is known as vfp on ARMv7 devices.

    Are you sure? This is not my field of expertise, but feinerer mentioned that the SoC, not the CPU, is lacking the FPU support. It would explain the symptoms you have described, too. I'll ask him via e-mail for clarification.

    There's also a way of testing this theory: can you boot TWRP or Android, copy over the busybox-static armhf binary from Alpine and execute it on the device?

    By Oliver Smith on 2019-01-07T07:00:00

  • Author Owner

    @ollieparanoid, yes, I'm sure. /proc/cpuinfo doesn't lie and I have already run postmarketOS binaries with the LineageOS kernel for that device (as I mentioned earlier).

    By Matthias Berndt on 2019-01-07T07:47:13

  • Author Owner

    I see, sorry for the confusion.

    By Oliver Smith on 2019-01-07T07:52:14

  • Author Owner

    The third is that a boot.img built from the LineageOS kernel image and the unmodified postmarketOS initramfs with the maximum-attention hook will not make the device vibrate or blink. What this tells me is that the maximum-attention hook is not run at the earliest time where that would be possible, which makes it less useful than it could be – after all, everything that is done before that hook is run is just one more thing that can go wrong and potentially prevent the hook from running.

    FWIW, one can easily change the init script linked below. Just change the file, and run pmbootstrap checksum postmarketos-mkinitfs, pmbootstrap build --arch=armhf --force postmarketos-mkinitfs, then pmbootstrap zap and when you do another pmbootstrap install, your version should be used (you can check this by entering the rootfs chroot with pmbootstrap chroot -r and reading the file with cat). You could move the hooks to the very top, or directly hardcode the code from the maximum-attention hook at the top.

    https://gitlab.postmarketos.org/postmarketos/pmaports/blob/ffa2dad8ca790ee0f9fec0b1e3055ff7982cccd6/main/postmarketos-mkinitfs/init.sh.in#L21-24

    Unfortunately, I haven't made any progress producing a working kernel image, and I have no more ideas on how to proceed, so I'm giving up for now. I suggest you merge my work into a feature branch in case somebody else wants to pick it up – it is a bit more up to date, compiles with gcc8 and the deviceinfo is more correct (e. g. it will now produce a boot.img).

    We do have at least one kernel that boots when compiled with GCC-6, but not with GCC-8. Since this is an older device, I'm wondering if it would boot if we compiled the kernel with GCC-4.

    By Oliver Smith on 2019-01-08T09:17:43

  • Author Owner

    Not to disparage other people work, but for as much as that seems actually the most updated kernel for the device... the "platform" as a whole might have advanced quite further

    https://github.com/OpenDesireProject/android_kernel_htc_msm7x30

    https://github.com/shugaoye/android_kernel_htc_qsd8k/branches/all

    https://github.com/rqmok/android_kernel_htc_msm7x30

    By mirh on 2019-01-10T01:34:37

    Edited by Administrator
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading