Giter Club home page Giter Club logo

linux_huawei_mate-9's Introduction

The kirin960/ Huawei Mate9 can run native linux better then I expected. This is the kernel hopefully more to follow. To boot and stay booted (no watchdog//timed shutdown etc) currently requires very hackish patches. This is very much a ruff draft. This kernel if for/from the android 7 release, I stayed with 7 because I didnt want to loose having ramdisk in same boot image without kernel hacks, also the older version has less security. Downside is the firmware sucks especially at cpu speed/temp control and bring up. Also the undocumented not meeting the standards devicetree partition is a fn nightmare. You can create a new dts.img using the huawei/hisi modified dtbTool in the tools folder. Leave it in tools folder it likes it there. But instead of using the built into kernel source dtc Id suggest a newer version with -@ support. Must be 6 to 8 major variations of dtbTools, with hundreds of forks....not a one for Huawei's nonsense. I started creating one so we would have an open source alternative but Havent gotten back to it. Hikey made the hikey960 a kirin960 sbc and they have a tool for boot images and dts.img but not compatiblr with my version 7. Each kernel version release came with a new version of android and bootloader/firmware so very possible the tool they released will work on newer firmware. I may have found a way to have 2 kernels (One for linux, one for android) each get given a different dtb by the bootloader but have not tested it yet. I was tired of playing whack a mole with everything who wanted to shutdown the phone everytime the power button was hit after installing..well anything, so it now sends F12 instead. RPMG, DRD, BFM have either been deleted/disabled/or hindered, along with plenty of others im sure. Very very little info seems to exist for developing on these devices. I just got the accell and gyro working in linux. The touchscreen sends only dual touch events (out of spec) evdev is supposed to automatically fake the singles but fails to do so, leaving the evdev X11 driver stone dead. But libinput reads it fine. Mali G71 doesnt have X11 drivers only fbdev and wayland (wayland libs are needed to run X11, i know confuing right?) This kernel is old, Ill eventually patch a newer one (5.10 or newer) to boot with the shit support for the cpu's this firmware has and panfrost going. Sound I havent tackled yet but I dont currently know of any reason why it cant work.Couple of things the nexmon wifi firmware hacking tools work with this phones wireless card/firmware. Also the modem is the same type as those little cell based hotspots. So the tools for reading it nve etc (plenty of them) work! Even the firmware upload is same protocol for those modems as the emergency download test point mode of the phone! I dont use windows so I hacked up the cross platform version to potatonv, maaking it actually work and also having it unlock the bootloader AND fastboot plus finalizing the autounlocking at end. Its somewhere on this git account i think icalled it macncheese. Some great tools exist for reading/writing the phones nve, most are windows but a few good ones for linux. Also a few for the oeminfo partition as well. With those you change one byte and you have rebranded for another region. Various drivers/debug options etc are removed bby huawei from the kernel source for all the played out reasons, but a few sysfs debugfs files worthy of note;

THESE FILES USUALLY CAN BE FOUND IN MULTIPLE PLACES IN /ssys

/sys/devices/virtual/misc/sensorhub/subsystem/nsec_isp_miscdev/sec_nsec_isp <-- this maybe a biggy

/sys/class/misc/isp_rdr_miscdev/rdr_isp

/sys/class/misc/atf_ispdev/atfisp

/sys/kernel/debug/contexthub/shell_dbg <-- is removed before release in all newer releases

QQcom socs also running mali gpu's usually need a tool msm-refresher to constantly poll the video card for updates (otherwise screen wont ever update) I ran it for a week before finding

echo 1 > /sys/class/graphics/fb0/frame_update

With this msm-refresher just needs to make a single request then can be shutdown and screen auto refreshes! Plenty of other files that are awesome as well. Despite having something like drivers from mali, X11 is tricky. Lightdm needs to start, then fail, then sit, i find 20 seconds works, then restart it , but before starting it (both times) chvt 1 needs to be run, it cannot start on vt7 if your currently on it, despite the kernel config.

Serial 6 is broken out on the testpoints below the ones used for edl mode. Enabling serial in fastboot will give you debug msgs (with a horrible clock) thru the entire boot/run/shutdown even on android, also the pins are muxed out the usb-c (my port is bad so no idea which pins) that being said transmitting from PC to phone does not work for me with usb connected, But do to the clocking issues/bad usb port I cannot use from PC to phone.But phone to pc works, minus missing charactors etc. I do believe j-tag is muxed with sdcard pins so if you can rig up an adapter?

atcmdserver is a unbelievably powerful tool/server that could do it all even read bootloader unlock codes plain text/upgrades/name it, but its encrypted comms and needs special software or key, more on that later.

I throw my linux boot.img on erecover IE recovery2, it didnt seem to work plus i have test point edl, thanks to the rediculous boot msg warning about being rooted and kindly option to boot erecovery, it worked great.I then throw a linux rootfs on an sdcard and point the kernel to it. Ill throw my Android-image-kitchen with my ramdisk etc in the tools folder.

Well that seems good for a first commit.

linux_huawei_mate-9's People

Contributors

bm16ton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.