[coreboot] for Lenovo G505S owners: AtomBIOS ROMs (discrete too!), binaries, datasheets...

Mike Banon mikebdp2 at gmail.com
Sun Jul 16 14:31:54 CEST 2017


Replacing #!/bin/sh with #!/bin/bash also works! Although maybe its a
good idea to still do this hex-to-dec numbers conversion if it results
in more portable code

>
> Cool! You may also want to close and open the lid ;)
>

Its hard to open/close lid at half teardown G505S so I just cheated by
reading the source code to find out what happens ;)

>
> ... I'd really like to keep it semi-public for now
>

OK, understood

>
> Also if you attach the UART to it, you will get a functional console
>

Could you please tell which USB-to-UART adapter you are using while
connecting to JP3 port ? And what is your connectivity diagram: are
you connecting just 2 and 3 wires (EC_TX and EC_RX) or 1 and 4 also (
+3VALW and GND ) ?

I'm going to get 10 pcs of 4P FPC connectors (such as these for $1 -
https://www.aliexpress.com/item/Cloukeu-10Pcs-FPC-Connector-socket-FFC-1-0MM-Drawer-Bottom-Contact-type-4-5-6-7/32814560472.html
) to solder one of them to JP3 UART port - just in case I couldn't get
UART from a port of MiniPCI-E diagnostic card

Will cut a spare FPC 30P 1.0mm pitch keyboard-like flex cable to get a
4P one. This connection will allow to easily attach/detach the UART
without soldering/desoldering it each time ; meanwhile I'll have to
use something like a Morse code for these leds :)

Best regards,
Mike Banon

On Sun, Jul 16, 2017 at 11:26 AM, Paul Kocialkowski <contact at paulk.fr> wrote:
> Le dimanche 16 juillet 2017 à 11:10 +0300, Mike Banon a écrit :
>> Hi Paul, here is my proposed fix for ./origami-ec/tools/segments to
>> make it more portable across the different bash versions :
>
> I think the problem is that you are not using bash in this case. The
> script has /bin/sh as shebang, but it's really written in bash (with
> non-POSIX extensions). Given the number of non-POSIX things that I'm
> using in there, it's probably easier to just switch:
> #!/bin/sh
> to
> #!/bin/bash
>
> Could you try that and report back?
>
>> 1) replace
>>
>> if (( $size > $size_limit ))
>>
>> with
>>
>> if [ $(printf "%d" ${size}) -gt $(printf "%d" ${size_limit}) ]
>>
>> 2) replace
>>
>> if (( $offset < $map ))
>>
>> with
>>
>> if [ $(printf "%d" ${offset}) -lt $(printf "%d" ${map}) ]
>>
>> After these changes the hexadecimal numbers are converted to decimal
>> before the comparison. Now this script works OK and the whole build
>> completes without any error
>>
>> I have tested your firmware at my G505S, the LEDs are working ;-) and
>> are changing their state if I press a button.
>
> Cool! You may also want to close and open the lid ;)
>
> Also if you attach the UART to it, you will get a functional console.
>
>> Maybe its a good idea to launch this project publicly by creating a
>> mirror at GitHub, so that the people could easily commit the pull
>> requests and send their comments - and then the merged pull requests
>> could be synchronized with your home repository at git.code.paulk.fr ?
>> What do you think about this idea?
>
> I already have very specific plans about launching the project publicly
> (that do not involve using github). I am working hard on that. In order
> to drag some interest in the project at the time it is launched, I would
> ask that you don't spread big news about it yet. I'd really like to keep
> it semi-public for now.
>
> Also I strongly prefer to do code review via dedicated mailing lists,
> with text patches instead of web interfaces (that really do not fit well
> with my workflow).
>
> Thanks for your suggestions and interest in the project!
>
> Cheers,
>
> Paul
>
>> On Sat, Jul 15, 2017 at 6:58 PM, Paul Kocialkowski <contact at paulk.fr>
>> wrote:
>> > Hey,
>> >
>> > Le samedi 15 juillet 2017 à 16:53 +0300, Mike Banon a écrit :
>> > > Dear Damien, thank you for your interest!
>> > >
>> > > These repositories are not raising G505S free-as-in-freedom level,
>> > > just trying to improve the things: e.g. make a discrete GPU
>> > > working
>> > > and erase serial IDs from EC KB9012 proprietary firmware. To
>> > > clarify:
>> > >
>> > > 1) g505s-atombios : contains the AtomBIOS ROMs for discrete GPU of
>> > > G505S.
>> > > AFAIK nobody has successfully extracted these discrete ROMs
>> > > before!
>> > > If your G505S had integrated GPU only you couldn't benefited from
>> > > them,
>> > > but my G505S has a discrete GPU also - which does not work with
>> > > coreboot.
>> > > And I really hope that having two AtomBIOS ROMs inside
>> > > coreboot.rom
>> > > (integrated + discrete, e.g. both pci1002,990b.rom and
>> > > pci1002,6663.rom )
>> > > will help me to make this discrete GPU working. Going to test it
>> > > soon
>> > > :D
>> > >
>> > > 2) g505s-proprietary : contains the motherboard's LA-A091P and EC
>> > > KB9012
>> > > keyboard controller datasheets, and Lenovo's Hardware Maintenance
>> > > Manual
>> > > (sometimes helps to find the replacement parts, such as the new
>> > > screws)
>> > > Of course many of us already had these files, but it also contains
>> > > a
>> > > clean EC KB9012 ROM - extracted directly from BIOS updating
>> > > software!
>> > > Compared to what is flashed at G505S by default, this clean ROM
>> > > doesn't
>> > > have any IDs, therefore flashing it slightly improves your
>> > > anonymity
>> > >
>> > > > It would be good to get this chipset working with Timothy's
>> > > > non-AGESA ram init, which I was working on at an earlier time
>> > > > but
>> > > > got
>> > > > stuck and ran out of time.
>> > >
>> > > Please tell, have you uploaded your unfinished work somewhere?
>> > >
>> > > > I believe the EC has been done too by Paul
>> > >
>> > > Thank you very much for this information! Do you know whether
>> > > it has been 100% completed and G505S boots with it, by a chance?
>> > >
>> > > http://git.code.paulk.fr/gitweb/?p=origami-ec.git;a=summary
>> > >
>> > > I am getting a few problems while trying to build:
>> > >
>> > > tools/segments: 19: tools/segments: 0x000016A4: not found
>> > > tools/segments: 19: tools/segments: 0x00000C2C: not found
>> > > tools/segments: 19: tools/segments: 0x00000E07: not found
>> > > tools/segments: 69: tools/segments: cannot open 0x0000: No such
>> > > file
>> > > tools/segments: 69: tools/segments: 0: not found
>> > > tools/segments: 69: tools/segments: 49152: not found
>> > > tools/segments: 69: tools/segments: cannot open 0x10000: No such
>> > > file
>> > > tools/segments: 69: tools/segments: 65536: not found
>> > >
>> > > Perhaps the tools/segments bash script is not portable enough,
>> > > I will try to fix it and contribute a solution in the near future
>> >
>> > To answer the question, no, it is not finished. Far from it. There
>> > is
>> > very little visibility regarding the project as it was not launched
>> > publicly yet (even though the source code I'm working on is already
>> > available).
>> >
>> > Too bad that the script does not work with your setup, reasonable
>> > fixes
>> > to make it work would indeed be welcome! It works fine on my setup.
>> >
>> > > > the only thing remaining apart from the hardest part (ram init)
>> > > > would be
>> > > > the vga init, (which Alex already did 95% for this particular
>> > > > hardware)
>> > >
>> > > Curious to hear about Alex's open source VGA init. Most likely it
>> > > has
>> > > been
>> > > written with integrated-only GPU in the mind, but if it will
>> > > become
>> > > the last
>> > > obstacle before fully liberating G505S --> then I could try to
>> > > complete it
>> > >
>> > > > I no longer have the laptop hardware with me so this is going to
>> > > > be
>> > > > problematic for me to do much work on it in the near future.
>> > >
>> > > Its very sad to hear. G505S is the most powerful portable coreboot
>> > > hardware
>> > > without Intel ME / PSP backdoors, and I hope that more of these
>> > > wonderful
>> > > laptops will end up at the hands of opensource/privacy-caring
>> > > people
>> > >
>> > > Luckily this laptop's default thermal paste is of very poor
>> > > quality,
>> > > and
>> > > when it starts easily overheating after a couple of years - a lot
>> > > of
>> > > people
>> > > are simply selling it instead of changing its' thermal paste!
>> > > Partially
>> > > because of that, partially because a lot of G505S have been
>> > > manufactured,
>> > > it is easy to find this laptop at eBay/craigslist for a very cheap
>> > > price!
>> > >
>> > > For example, just $100 dollars:
>> > >
>> > > http://www.ebay.com/itm/Lenovo-G505s-20255-AMD-A10-6gb-Ram-No-Hdd-
>> > > Part
>> > > s-Repair-/332298782671
>> > >
>> > > If I were at USA I would have definitely bought, need just $59 to
>> > > refurbish
>> > >
>> > > 1) 8cells battery, more capacity than original! $33 -
>> > > https://www.aliexpress.com/item/8-Cell-Battery-for-Lenovo-IdeaPad-
>> > > G400
>> > > s-G405s-G505s-G410s-G510s-S410p-S510p-Z710-L12L4A02-
>> > > L12M4A02/32819127987.html
>> > >
>> > > 2) replacement keyboard, $12 -
>> > > https://www.aliexpress.com/item/Free-Shipping-US-keyboard-for-leno
>> > > vo-I
>> > > deapad-G505S-FLEX-15-G500S-S500-Z510-US-laptop-
>> > > keyboard/1945098518.html
>> > >
>> > > 3) bottom cover, $14 -
>> > > https://www.aliexpress.com/item/New-For-Lenovo-G500S-G505S-Bottom-
>> > > RAM-
>> > > HDD-Hard-Drive-Cover-Door-balck/32819067218.html
>> > >
>> > > + new thermal paste and some 100% alcohol for disinfection,
>> > > then could put SSD and 16 GB of RAM there for a beast machine ;)
>> > >
>> > > > I'm not sure if you are allowed to redistribute proprietary
>> > > > roms/datasheets
>> > >
>> > > It depends on your location - different countries have different
>> > > laws.
>> > > At my place I am allowed to use and even distribute them for not-
>> > > commercial
>> > > purposes (e.g. reverse engineering or just a hobby), at some other
>> > > places
>> > > the people are allowed to download these files but aren't allowed
>> > > to
>> > > share
>> > >
>> > > Sadly some countries have very strict copyright laws, e.g. at USA
>> > > I
>> > > would
>> > > have had to wait 75 years :P Many (if not all) GitHub servers are
>> > > at
>> > > USA
>> > > jurisdiction, but they can't sue me - only to take down my
>> > > repositories,
>> > > which I could easily re-upload to GitHub again or to somewhere
>> > > else...
>> > >
>> > > However, these datasheets have been at GitHub for almost a year
>> > > ( https://github.com/mikebdp2/kb9012-g505s-official ) and still
>> > > available!
>> > >
>> > > Probably because these datasheets aren't like a game or a movie
>> > > (when the manufacturer is losing money if someone else is
>> > > distributing
>> > > it)
>> > > in reality - nobody cares if you are distributing them. Multiple
>> > > times
>> > > I
>> > > have honestly tried to contact both Compal and ENE asking them if
>> > > they
>> > > don't mind me sharing the datasheets, but they have never replied
>> > > to
>> > > me
>> > >
>> > > Good luck to your projects,
>> > > Mike Banon
>> > >
>> > > On Sat, Jul 15, 2017 at 6:24 AM, Damien Zammit <damien at zamaudio.co
>> > > m>
>> > > wrote:
>> > > > Dear Mike,
>> > > >
>> > > > I am not sure what this is all about, but we already ported the
>> > > > G505s to
>> > > > coreboot.    I believe the EC has been done too by Paul,
>> > > > so the only thing remaining apart from the hardest part (ram
>> > > > init)
>> > > > would
>> > > > be the vga init, (which Alex already did 95% for this particular
>> > > > hardware).  I no longer have the laptop hardware with me so this
>> > > > is
>> > > > going to be problematic for me to do much work on it in the near
>> > > > future.
>> > > >
>> > > > By the way, I'm not sure if you are allowed to redistribute
>> > > > proprietary
>> > > > roms/datasheets, but IANAL.
>> > > >
>> > > > I wish you luck,
>> > > >
>> > > > Damien
>> > > >
>> > > > On 15/07/17 07:48, Mike Banon wrote:
>> > > > > Good day! Together with my friend Ivan we have opened a new
>> > > > > GitHub
>> > > > > page,
>> > > > >
>> > > > > https://github.com/g505s-opensource-researcher
>> > > > >
>> > > > > and created 3 repositories there:
>> > > > >
>> > > > > 1) g505s-atombios
>> > > > > AMD AtomBIOS video bios releases for G505S Integrated HD-8650G
>> > > > > and
>> > > > > discrete HD-8570M / R5-M230 GPUs
>> > > > >
>> > > > > 2) g505s-proprietary
>> > > > > Proprietary stuff: InsydeH20 closed source BIOS files,
>> > > > > documents,
>> > > > > binaries and datasheets for G505S
>> > > > >
>> > > > > Their files were described at our previous messages:
>> > > > >
>> > > > > https://mail.coreboot.org/pipermail/coreboot/2017-July/084660.
>> > > > > html
>> > > > > https://mail.coreboot.org/pipermail/coreboot/2017-July/084671.
>> > > > > html
>> > > > > https://mail.coreboot.org/pipermail/coreboot/2017-June/084569.
>> > > > > html
>> > > > >
>> > > > > All the SHA-256 checksums are available at sha256sum.txt text
>> > > > > files
>> > > > >
>> > > > > Also, we are going to set up 3) a bit later:
>> > > > >
>> > > > > 3) g505s-coreboot
>> > > > > coreboot open source BIOS releases for AMD-based Lenovo G505S
>> > > > > laptop
>> > > > > with A10-5750M quad core APU
>> > > > >
>> > > > > "3)" could be especially useful for the people who just
>> > > > > recently
>> > > > > became interested at coreboot/SeaBIOS projects - and would
>> > > > > like to
>> > > > > quickly test on their G505S laptop because of the official
>> > > > > BIOS
>> > > > > shortcomings (WiFi whitelist / poor thermal management)
>> > > > >
>> > > > > By the way, there were two typos at Ivan's cbfstool.sh script
>> > > > > -
>> > > > > two
>> > > > > missing "\" characters at the end of line. g505s-atombios
>> > > > > repository
>> > > > > has a working version
>> > > > >
>> > > > > Have the great weekends and happy hacking ;-)
>> > > > >
>> > > > > Wish you all the best,
>> > > > > Mike Banon
>> > > > >
>> >
>> > --
>> > Paul Kocialkowski,
>> >
>> > developer of free digital technology and hardware support.
>> >
>> > Website: https://www.paulk.fr/
>> > Coding blog: https://code.paulk.fr/
>> > Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/
> --
> Paul Kocialkowski,
>
> developer of free digital technology and hardware support.
>
> Website: https://www.paulk.fr/
> Coding blog: https://code.paulk.fr/
> Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/



More information about the coreboot mailing list