[SOLVED] How to unlock BIOS options of rebranded TONGFANG chassis systems?

I have bought this system a week back and need to install ubuntu linux on it. Everything is working except suspend/resume.
I see following errors during kernel boot. I have checked the BIOS. It is 1.0.8 (28/11/2018). On opowered.com/support, the driver zip contains BIOS 1.04 version. Thank you so much for your time.
```````````````````
Feb 14 10:59:34 amit-OP-LP3 kernel: [ 0.185787] ACPI Error: Field [SAC1] at bit offset/length 64/64 exceeds size of target Buffer (64 bits) (20180531/dsopcode-201)

Feb 14 22:32:08 amit-OP-LP3 kernel: [ 5.141471] ACPI BIOS Error (bug): Could not resolve [_SB.PAGD._STA._OSI], AE_NOT_FOUND (20181003/psargs-330)nel: [ 5.141588] No Local Variables are initialized for Method [_STA]
Feb 14 22:32:08 amit-OP-LP3 kernel: [ 5.141592] No Arguments are initialized for method [_STA]
Feb 14 22:32:08 amit-OP-LP3 kernel: [ 5.141599] ACPI Error: Method parse/execution failed _SB.PAGD._STA, AE_NOT_FOUND (20181003/psparse-516)3 kernel: [ 5.154212] ACPI BIOS Error (bug): Could not resolve [_SB.PAGD._STA._OSI], AE_NOT_FOUND (20181003/psargs-330)nel: [ 5.154373] No Local Variables are initialized for Method [_STA]
Feb 14 22:32:08 amit-OP-LP3 kernel: [ 5.154379] No Arguments are initialized for method [_STA]
Feb 14 22:32:08 amit-OP-LP3 kernel: [ 5.154386] ACPI Error: Method parse/execution failed _SB.PAGD._STA, AE_NOT_FOUND (20181003/psparse-516)3 kernel: [ 5.155791] ahci 0000:00:17.0: version 3.0

```````````````````````````````````````

@pcfr33k - If you don’t mind, and when you have a second, can you test S3 sleep for @geekasm in windows, and in Linux (Live CD should be OK I think), to see if you have any issues. He’s on same latest 1.08 BIOS as you, I mentioned maybe 1.04 does not have the bug, but he’d have to test.
Thanks

I don’t know about these settings, or what is ideal etc, mainly putting these out there in case geekasm notices something, but I checked and at Advanced ACPI I see “Enable ACPI Auto Configuration” is disabled, maybe this needs to be enabled? Hibernation and S3 are enabled by default, under that

Enable TCO Timer is disabled by default (related to ACPI in someway?) This is at Advanced >> PCH/IO Config (Root) - DeepSx Power Policies also disabled, same location. LAN wake from DeepSx, and wake on LAN are enabled by default.

@geekasm - if you want an unlocked BIOS so you can adjust all this stuff and test, please send me a FPT backup from your system and I will send you back unlocked BIOS >> FPTw.exe -bios -d biosreg.bin


Thanks tons ! I would love to update BIOS stuff. however, this is my work system and I dont want to mess something.
At present, anyways, cant get the suspend/resume to work :slight_smile: ll, of course, ping you back later.

Observations:
* In windows, suspend/resume works perfectly.
* In BIOS, I cant see any of the settings which you highlighted. (advanced acpi, no advanced >> PCH/IO menu) :frowning:

I am going to try flashing 1.04 bios. and get back

THanks,

I have searched around but couldnt find the ftpw.exe tool. where could I get it from ? Thanks.
update:
found it. used it to copy the bios

If you should mean the tool named fptw.exe, it is part of the matching “Intel CSME System Tools”, which can be found >here< (chapter C2).

This is the procedure: Click onto the “Edit” button of the thread opener post. Then you can change the text of your post and the thread title as well. Try it!

Done!

Linux in general does not handle power states very well at all. This is basically on any distribution. I have an unlocked BIOS right now on my OP-LP2 courtesy of LNB and nothing I’ve tried has made it stable. My last 3 laptops all had issues with it as well and I’d used Linux daily for the past 10 years. So in my opinion, it is a Linux kernel related issue and won’t be solved by BIOS hacks, although you are more than welcome to try.

It doesn’t help that this uses Optimus graphics, where both the iGFX and dGFX are on and switching at the same time, which makes resume come up to a blank screen on many occasions. From my testing, you can only fully turn off the NVIDIA dGFX in the BIOS, which means you lose performance + external display support. It does, however, make suspend/resume slightly better. If you try to fully disable iGFX, you will get a black screen as soon as you power up … Optimus seems to default to iGFX on boot up and switch over to dGFX later. PRIME sync does not work all that reliably either and you will probably notice screen tearing, which is another issue all together.

Thanks so much for responding, @nimaim
It is disappointing that I cant use this laptop. However, it makes it much more easy for me to just return this laptop.
Because, I have the wasted a lot of time trying different combos. latest ubuntu, latest kernel, latest nvidia drivers (415)
tried removing both nouveau and nvidia so that I can work only with the integrated graphics and i915 driver. however, with that as well, I see resume issue.
Without suspend/resume, laptop is practically worthless to me.

I am OK with switching to windows to use nvidia. however, suspend/resume functionality needs to work to make it usable as a daily workhorse.

Totally understand @geekasm … I also use mine for work. For now, my workaround is to set up a swap partition and enable hibernation. Resuming from hibernate is a bit better, but also has some minor issues. I am outside the return period and heavily invested in this already (plus got it at a steal of a price) so keeping mine now, but it is certainly not good for a reliable Linux setup. There is a lot that does not work in Linux: Optimus is completely broken, suspend/resume, keyboard backlight, fan control, etc.

I use Mint because we develop in it, but others have had better success with Manjaro (which uses Arch Linux as a base, which is pretty solid). Before you return it, maybe try another distro?

I also think if you disable the nvidia GPU, you may have much better luck. Second thing I’ve heard to try is to unload the i2c_hid module before a suspend and reload it after resume, via a systemd hook (it’s as easy as this: https://blog.christophersmart.com/2016/0…d-with-systemd/). I know that module causes issues with some things, many times it won’t properly come back after a resume and you’re forced to do a hard reboot.

EDIT: Removing the driver will not do anything, you will have to force disable it in the BIOS, which must be unlocked. You can turn off power to the GPU there. LNB can help you with this, just get him your FPT dumped BIOS to mod.

Thanks @nimaim . I must say this forum has been super helpful.
I also have a swap partition and enabled hibernation. But I dont know how to make it the default. I ll check.
Yes, I got it at $1K, so wanted to keep it. I ll certainly try your suggestions, like of manjaro.

My query is that would walmart take it back, if I mod the BIOS and return it ?

I have shared the BIOS already. ll wait.
Thanks again.


A programmer is only $5 and very easy to use, and does not require soldering. I would recommend dumping your full original BIOS and flashing it back if these suggestions don’t work. If not that, at least back up BIOS region with FPT (FPT -d biosname.bin -bios).

Follow these steps to get hibernation working. This is for Mint but Ubuntu should be very close to identical (same base): https://forums.linuxmint.com/viewtopic.php?t=273202

Thanks @nimaim , I am downloading manjaro.
have never used a programmer. can you kindly suggest which one to order from ebay/amazon ?
I have copied the bios already.

ll follow steps for hibernation and get back. however, my original question was that laptop skip sleeping altogether and hibernate. otherwise, it ll be an issue to resume from sleep.

If it’s skipping sleep altogether there is a more serious problem with your set up, definitely try another distro just to confirm if it’s OS related or something else.

Programmer wise, follow these tutorials and links, lot of advice in these posts: [GUIDE] The Beginners Guide to Using a CH341A SPI Programmer/Flasher (With Pictures!) and [Guide] Using CH341A-based programmer to flash SPI EEPROM. If you look on Amazon or Ebay for a CH341A programmer and SOIC8 test clips, you will see lots.

ordered programmer, ll take a while to reach. Thanks for the programmer links
Also, downloading manjaro, ll get back.
About sleep, laptop is not skipping sleep. Its sleeping OK. but on resume, screen is frozen (black mostly), with only mouse showing at a fixed location .
My point was that if hibernate/resume works , then laptop should hibernate rather than sleep. because resumption from sleep is problematic


Thank you so so much @nimaim
i2c_hid seems to be THE culprit, so far. I have tried suspend/resume thrice and it has worked correctly. Hopefully, it ll work well. I ll keep you posted. But, thanks so much again.

Also, Can you elaborate on why removing driver wont work. and we would need to disable it in BIOS ? I thought issue is at kernel side. If the module is not loaded, then it would be as good as HW not being there ?

@geekasm Great, good to hear! Long story short is basically Optimus and this laptop uses a muxless set up, meaning there is no hardware (discrete) switch to control the graphics. Even if you unload the driver, dGFX will be on. That’s just how it works. Simple way to check is to install tlp-stat and run tlp-stat -b to see how much current it is pulling. If it’s > 1000 mA (1A) closer to 2-3A, it’s a telltale sign it’s on. iGFX only keeps it under < 1A easily. I blacklisted the nvidia driver so it never loaded, but it just makes things worse. It simply gave me massive screen tearing on Mint.

The correct way to unload it is to turn it off in the BIOS, or issue an ACPI call like found here to physically turn off the PCIE bus it is sitting on: https://wiki.archlinux.org/index.php/hyb…Using_acpi_call (don’t use bbswitch, it’s broken on recent kernels).



Thanks. I ll read more about optimus ! waiting for bios to flash and play around with settings !
installed tlp-stat, I can see it is consuming ~2A.
I have uninstalled nvidia driver and confirmed that nvidia is not loaded (via lsmod | grep nvidia). screen tearing is not happening to me.

PS: Yes, and now I resumed it after 1.5 hours, it resumed :slight_smile: I am happy!

Update: Thanks again, for more than doubling my battery performance with that acpi_call stuff. A W E S O M E. you have single handedly done, what opowered support could have done :stuck_out_tongue:

@geekasm - yes, the things I mentioned would only be visible to you on the unlocked BIOS. I’ve got your dump via PM and will edit in unlocked BIOS for you shortly.
Don’t worry, nothing will be messed up, we’ve tested these mods at length and figured it all out perfectly now. Sorry for not linking the ME system tools, I thought maybe you had read this thread in full and already figured all that out. Thanks for linking them up @Fernando

@nimaim - thanks for the info on Linux and power states! I just assumed maybe BIOS bug, since BIOS are notorious for having sleep issues, some versions work, some don’t, and sadly some never get fixed by manufacture
And thanks for helping geekasm with the sleep issues and workaround too

@geekasm - with SSD these days, it’s nearly just as fast to shut down properly as it is to sleep/resume, so this shouldn’t be as big of an issue as it might seem.
Walmart wouldn’t know if you returned it with a mod BIOS or original only the lucky guy they re-box it for would get the unlocked BIOS if you leave it in there
Here is your mod BIOS >>http://s000.tinyupload.com/index.php?file_id=14584163208513423286
Flash via >> FPTw.exe -bios -f modbiosrg.bin

@Fan - here is your mod BIOS >> http://s000.tinyupload.com/index.php?fil…581353667010342
Flash via >> FPTw.exe -bios -f biosrgm.bin

Thanks so much. I have downloaded and flashed the bios. Its completed successfully and systems are booting fine.
I went into BIOS, its alot of options. will take time to read about it. Thanks so much !!!

If you/@nimaim could help me disabling the nvidia dGPU in BIOS, it ll be of great help.

@geekasm - thanks for report back I knew it would be OK and unlocked, but it’s always good to have quick report back of success, because sometimes I make mistakes when redoing, we’re only humans

On the dGPU stuff, nimaim covered all that in the last page or two. Since you are playing with this, best to familiarize yourself with @pcfr33k method to blind recover from bad flash or bad graphic setting choices, here’s the two posts he’s covered that in previously
[SOLVED] How to unlock BIOS options of rebranded TONGFANG chassis systems? (12)
[SOLVED] How to unlock BIOS options of rebranded TONGFANG chassis systems? (13)