Giter Site home page Giter Site logo

ayilm1 / gmuxbypass Goto Github PK

View Code? Open in Web Editor NEW
36.0 7.0 16.0 207 KB

Bypass graphics multiplexer on 820-2914 and 820-2915

License: GNU General Public License v3.0

VHDL 36.85% TeX 5.69% Tcl 0.84% Common Lisp 0.70% HTML 50.18% Verilog 0.57% Roff 5.16%

gmuxbypass's Introduction

gMUXBypass

Overview

This HDL overwrites the configuration on the Lattice XP2 on the 820-2914 and 820-2915 boards to buffer the iGPU LVDS signals directly to the LCD. It also powers down the dGPU to conserve power

Synthesised Variants

There are two variants that can be synthesised; PWM and NoPWM. This is selectable by setting USE_PWM in the module parameter definitions. There are also pre-built JEDECs available in the repo if you don't wish to synthesise these yourself. They can be flashed using the standalone Lattice Diamond Programmer.

Variant USE_PWM Pre-built JEDEC File Description
NoPWM 0 gMUXBypass_NoPWM.jed 100% duty-cycle brightness. FPGA_N2 is tied high.
PWM 1 gMUXBypass_PWM.jed Brightness controlled by PCH. FPGA_N2 is tied floating. Need to connect LCD_BKLT_PWM to NC_LVDS_IG_BKL_PWM.

The NoPWM variant has no brightness control. It will never be possible to perform brightness control via the LPC interface natively, as the AppleMuxControl.kext responsible for managing the FPGA gMUX is contained within AppleGraphicsControl.kext, which in turn is only loaded if the dGPU is present on PCIe. It may be possible to write a new extension which just sends brightness control commands over the LPC interface (Lattice has a free LPC IP block here), however this is likely a lot more work and isn't necessarily update-proof.

For this reason, the second variant has been created. This simply sets the N2 (LCD_BKLT_PWM) output of the FPGA high-impedance so an external source is free to drive it. The NC_LVDS_IG_BKL_PWM signal from the PCH is then connected up to LCD_BKLT_PWM (I used R9693-1 for my implementation) so the iGPU has full control over the panel brightness. This makes the 820-2915 functionally identical to the 820-2936 from a brightness control perspective. As far as the OS is concerned, this is a integrated-only system.

Hardware Modification

Due to the loss of the post on advancedreworks, I have put all the critical information needed for connecting up the PWM signal from the PCH here. It is not as complete a guide as the forum post was, but this is all I have time for right now.

The location of the PCH interposer via we're interested in is as follows:

Once you have located this point, mark it with a small nick in the solder mask. Proceed to then scratch at the mask layer until you hit the first ground plane layer.

Cut through this with your pick and continue through the dielectric below. You should see feint evidence of the top of the via. Continue removing dielectric material until you reach the shiny copper top.

How you choose to connect to this via is up to you at this point. I used some copper tape mounted to the interposer, and one strand of a scrap piece of stranded wire. The copper tape gives strain relief through mechanical isolation. Images below to serve as an example.

I ran the connection to pin 1 of R9693 (LCD_BKLT_PWM) on my implementaion. However after updating my version of OBV, I noticed there appears to be a test point on the PCH side just below C9623 that may also be used. This should save from having to run the wire to the other side of the board.

Disclaimer

I am not responsible for any damage this causes. This has been tested on an 820-2915 successfully, but YMMV. The FPGA's original configuration cannot be backed up. This means this process is irreversable and once reprogrammed, the original configuration programmed by Apple will be irrecoverably lost.

License

GPL

gmuxbypass's People

Contributors

ayilm1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmuxbypass's Issues

Is bootcamp useable?

Hello,

is it possible to use bootcamp with this firmware? I heard that there could be some issues with it. I haven't tried it yet tho..

AppleGraphicsControl.kext (from Sierra version 3.13) can control brightness even if the dGPU is missing on PCIe

I have a 820-2915 with r8911 removed(also with nvram variable set), so dGPU is NOT powered and therefore missing on PCIe(can be further confirmed also via lcpci under linux). It was mentioned on the README that
AppleMuxControl.kext will not load when dGPU is missing on. This is true for latest version of AppleMuxControl.kext.

However, when old version of AppleMuxControl.kext (version 3.13, from Sierra 10.12.1) is installed on this machine, it will actually works and can control the brightness with the iGPU(I tested myself and this works also on High Sierra, Mojave, Catalina). Source: https://forums.macrumors.com/threads/disable-a-failed-amd-gpu-on-a-2011-macbook-pro-grub-solution.2087527/post-27525770

The linux gmux driver must have done a great deal to reverse engineer this gMux thing and documented it pretty well. (https://github.com/torvalds/linux/blob/master/drivers/platform/x86/apple-gmux.c), it has defined

#define GMUX_PORT_MAX_BRIGHTNESS 0x70
#define GMUX_PORT_BRIGHTNESS 0x74
#define GMUX_PORT_VALUE 0xc2
#define GMUX_PORT_READ 0xd0
#define GMUX_PORT_WRITE 0xd4

along with many other things, as well as a code block of brightness control.

Is there a way to get gMUXBypass to work with AppleMuxControl.kext version 3.13 to control the brightness without the soldering the microvia?

will this possibly work on 820-2850?

I compared the gmux pin out of the 820-2850 (2010 15") with 820-2915 (2011 15") on schematics and found out that the pins are the same (except some minor naming differences).

Would this actually work on the 820-2850? I have a few with defective GPU (no, it isnt faulty C9560 tantalum capacitor)

Screen flickers from wake

Prior to gMUX programming on the board i used NVRAM to bypass and screen don't flicker when waking up the machine but after gMUX proramming the screen flickers for a moment when waking up, tried both variants andt same issue.

New GMUX version with PWM backlight control (BIL button)

Hello and thank you very much for sharing your knowledge !
Based on your source code, I am currently implementing a new version of the verilog that controls the backlight, generating a variable PWM signal, that can change when pressing the BIL button.
It is still work on going but I should complete it soon.
If you are interested I will be able to share my work (despite the fact that I don't know yet how to push my files on github)
Feel free to come back to me.
Romain

You can dump original Apple firmware

Hey, I saw that in your disclaimer you wrote that the original Apple FPGA firmware will be lost, however this is not entirely true. With the Lattice XP2 software, you are able to dump the original firmware, and are able to save it, and use it.

This is not an issue just wanted to share some knowledge. Thanks

programmin on the lattice

it seems that my programmer ca not communicate with the fpga chip. getting a failed to scan board. soldered good. tried to flash anyway and get failed to verfy ID (expected 0x01299043 Read: 0x00000000) Error check configuration setup. any suggestions are to what to check in this regards?

thx

Displayport output ?

Hi All,
looking again to the FPGA design and the schematics to answer feedbacks in issue #8, I see that the 2 signals that control the DP multiplexer are not driven at all. Electrically speaking, I see no reason why we could not configure the DP Mux (U9220) to route the Integrated Graphics DP up to the DP connector.
Is someone aware of any software restrictions that prevent it ? Maybe the kext file is not activating properly the DP_IG_xxx lines ?
We could try a new FPGA design that control this mux to re-enable the DP output ?
Any advices here ? (my knowledge of the software side is limited)
Thanks :-)

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.