Discussion:
[linux-sunxi] Firmware extractor for GSL168x chips
Sergio Costas
2015-05-24 11:43:20 UTC
Permalink
Hi all:

I created a firmware extractor for these chips. Hope it is useful.

Some notes:

* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
r***@gmail.com
2015-05-24 11:49:32 UTC
Permalink
Forgot to comment that this code extracts the firmware from a running GSL168x chip. This means that you should compile it statically and run it in the original Android system, to get the firmware.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-05-24 21:22:02 UTC
Permalink
Thank you very much! This tool is one that what is missed in complete set
of make it working GSL1680.

Have ported your code to baytrail.

1st - these lines I think is rudшmental in section include (it is
important for porting! ) and came from user space driver where was used
uinput device.

#include <linux/input.h>
#include <linux/uinput.h>


2nd: It is unbelievable but on Chuwi vi8 looks that "idiots" put touch
screen with more resolution than display resolution. After dumping I've got
the same story from which I was started - resolution of something like
x=1145 y=1725 - this is the same I have extracted from elf .ko file, this
is the same I've got with loading Silead.fw taken from Win 8.1.

On Chuwi Vi8 I dis this so: rmod gslx680_ts (be ready to connect external
keyboard because touch will not work or use linux scripting\piping to get
result) then I run twice!!! (only 2nd attempt was working)
Kind regards,

Serge Kolotylo.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michal Suchanek
2015-05-25 08:16:23 UTC
Permalink
hello,
Post by s***@gmail.com
2nd: It is unbelievable but on Chuwi vi8 looks that "idiots" put touch
screen with more resolution than display resolution. After dumping I've got
the same story from which I was started - resolution of something like
x=1145 y=1725 - this is the same I have extracted from elf .ko file, this is
the same I've got with loading Silead.fw taken from Win 8.1.
On Chuwi Vi8 I dis this so: rmod gslx680_ts (be ready to connect external
keyboard because touch will not work or use linux scripting\piping to get
result) then I run twice!!! (only 2nd attempt was working)
Kind regards,
As you have already fixed this there is no real problem with the
resolution mismatch.

You can also try patching the firmware with the correct resolution.

Thanks

Michal
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-05-25 12:24:43 UTC
Permalink
"You can also try patching the firmware with the correct resolution. "

How do you imagine to do this?

PS: Actually when I was 1st extract fw without this tool I was UNsure that
possible I do something wrong or incomplete. Even now I am not at all sure
that all you need just grab firmware. May be inside firmware there are some
parameters and in some weird way you should initialize it. Actually it
looks strange to have different resolution between touch screen and
display. Actualy I am only guessing "why" but do not exactly know why and
if everything was done in correct way.
Unfortunately Chuwi and Silead keep silence and are not open manufacturers
that ready to provide any info about their devices even for customers that
bought their products.
Regards,
Serge.
Post by Michal Suchanek
hello,
Post by s***@gmail.com
2nd: It is unbelievable but on Chuwi vi8 looks that "idiots" put touch
screen with more resolution than display resolution. After dumping I've
got
Post by s***@gmail.com
the same story from which I was started - resolution of something like
x=1145 y=1725 - this is the same I have extracted from elf .ko file,
this is
Post by s***@gmail.com
the same I've got with loading Silead.fw taken from Win 8.1.
On Chuwi Vi8 I dis this so: rmod gslx680_ts (be ready to connect
external
Post by s***@gmail.com
keyboard because touch will not work or use linux scripting\piping to
get
Post by s***@gmail.com
result) then I run twice!!! (only 2nd attempt was working)
Kind regards,
As you have already fixed this there is no real problem with the
resolution mismatch.
You can also try patching the firmware with the correct resolution.
Thanks
Michal
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sergio Costas
2015-05-25 08:34:29 UTC
Permalink
Yes, there are a lot of unneeded includes. Feel free to remove them. I
just took the original driver and modified the code "in-place", and
forgot to remove that.
Post by s***@gmail.com
Thank you very much! This tool is one that what is missed in complete
set of make it working GSL1680.
Have ported your code to baytrail.
1st - these lines I think is rudшmental in section include (it is
important for porting! ) and came from user space driver where was
used uinput device.
#include <linux/input.h>
#include <linux/uinput.h>
2nd: It is unbelievable but on Chuwi vi8 looks that "idiots" put touch
screen with more resolution than display resolution. After dumping
I've got the same story from which I was started - resolution of
something like x=1145 y=1725 - this is the same I have extracted from
elf .ko file, this is the same I've got with loading Silead.fw taken
from Win 8.1.
On Chuwi Vi8 I dis this so: rmod gslx680_ts (be ready to connect
external keyboard because touch will not work or use linux
scripting\piping to get result) then I run twice!!! (only 2nd attempt
was working)
Kind regards,
Serge Kolotylo.
--
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michal Suchanek
2015-06-02 17:15:52 UTC
Permalink
Hello
Post by r***@gmail.com
Forgot to comment that this code extracts the firmware from a running GSL168x chip. This means that you should compile it statically and run it in the original Android system, to get the firmware.
I tried the extractor on two tablets. On Inet 86vs I get something
extracted (each time different) but on Q8H the android kernel does not
have I2C_CHARDEV compiled. I tried building an i2c_dev module from the
A23-v1.0.tar.gz sources but the module does not load complaining
i2c_dev: no symbol version for module_layout. The vermagic of the
i2c_dev module and gslX680.ko pulled from the tablet appears the same
so the Chinese must have changed something without changing the
version. Also the CSI_VFE module fails to build with the SDK and I
have BT options not present in the tablet kernel config.

So while this might help with some tablets it's not going to work with others.

Thanks

Michal
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-06-04 13:35:25 UTC
Permalink
So while this might help with some tablets it's not going to work with
others.

I understand that tool that provides result immediately is cool but for the
case when it does not work anyone should try method that I have passed
before this tool was created:

1) Extract firmware from elf files of Android drivers (modules) - I have
wrote brief manual for this.

Owners of tablet with dualboot also could try to findout firmware from Win
OS, where it could be even in separate file.
Post by r***@gmail.com
Hello
Post by r***@gmail.com
Forgot to comment that this code extracts the firmware from a running
GSL168x chip. This means that you should compile it statically and run it
in the original Android system, to get the firmware.
I tried the extractor on two tablets. On Inet 86vs I get something
extracted (each time different) but on Q8H the android kernel does not
have I2C_CHARDEV compiled. I tried building an i2c_dev module from the
A23-v1.0.tar.gz sources but the module does not load complaining
i2c_dev: no symbol version for module_layout. The vermagic of the
i2c_dev module and gslX680.ko pulled from the tablet appears the same
so the Chinese must have changed something without changing the
version. Also the CSI_VFE module fails to build with the SDK and I
have BT options not present in the tablet kernel config.
So while this might help with some tablets it's not going to work with others.
Thanks
Michal
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Bentley
2015-05-25 14:10:54 UTC
Permalink
Post by Sergio Costas
I created a firmware extractor for these chips. Hope it is useful.
* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
It is great to see someone is still working on the gslx680 I had thought
the driver porting efforts had died out.

I have compiled and tried the tool but am having a bit of difficulty
getting any output. I am not sure I am entering the
parameter for the Device correctly... exactly what is it looking for here ?
the i2c device name ? I get "Cant open device error"
on all that I have attempted thus far.

I am attempting to make an android driver for my Touchscreen on an A31s
Q711C_2M_PG iNet board. This seems to be a bit of
an out of the ordinary driver and I have been completely unable to obtain
any source code for it, although I have a Large number
of sources that I have downloaded from many places. In any case I would
like to make something similar to the sunxi-gslx680 and
Rastersoft drivers for Android ie ability to load firmwares from a file. I
have not yet tried to compile the Rastersoft version and my attempts
to alter the driver included with the A31SDK's have been unfruitful for
this Tablet so far. I used the firmware extractor from sunxi-gslx680
however i have not been able to do much of anything with the resulting file
due mainly to my Lack of any recent experience in C
programming and the differences in sunxi and sdk kernel code.

Thanks I hope you can help :-)
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sergio Costas
2015-05-25 14:25:35 UTC
Permalink
Hi:

An example:

extract /dev/i2c-1 firmware.txt 4

This will try to dump the firmware to a file called firmware.txt,
reading 4 bytes each time, and searching for the GSL chip in the first
i2c bus.
Post by Sergio Costas
I created a firmware extractor for these chips. Hope it is useful.
* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
http://www.rastersoft.com
It is great to see someone is still working on the gslx680 I had
thought the driver porting efforts had died out.
I have compiled and tried the tool but am having a bit of difficulty
getting any output. I am not sure I am entering the
parameter for the Device correctly... exactly what is it looking for
here ? the i2c device name ? I get "Cant open device error"
on all that I have attempted thus far.
I am attempting to make an android driver for my Touchscreen on an
A31s Q711C_2M_PG iNet board. This seems to be a bit of
an out of the ordinary driver and I have been completely unable to
obtain any source code for it, although I have a Large number
of sources that I have downloaded from many places. In any case I
would like to make something similar to the sunxi-gslx680 and
Rastersoft drivers for Android ie ability to load firmwares from a
file. I have not yet tried to compile the Rastersoft version and my
attempts
to alter the driver included with the A31SDK's have been unfruitful
for this Tablet so far. I used the firmware extractor from sunxi-gslx680
however i have not been able to do much of anything with the resulting
file due mainly to my Lack of any recent experience in C
programming and the differences in sunxi and sdk kernel code.
Thanks I hope you can help :-)
--
Nos leemos
RASTER (Linux user #228804)
***@rastersoft.com http://www.rastersoft.com
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Bentley
2015-05-25 14:54:31 UTC
Permalink
Post by Sergio Costas
I created a firmware extractor for these chips. Hope it is useful.
* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
Thanks !!

That did the trick, it read just fine and the output is in a form I am
pretty sure I can work with and finally be able to
make a driver for this tab that will run with a Kernel Other than the iNet
Provided ones. Your work on this is Truly appreciated.

If I do manage to get an Android driver that accepts files similar to the
output of your extractor as loadable firmware
I will be happy to share the sources. It will most certainly end up on my
Github account, but if there is any interest in it
let me know.

Thanks Again ! :-)
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Bentley
2015-05-27 08:20:07 UTC
Permalink
Post by Sergio Costas
I created a firmware extractor for these chips. Hope it is useful.
* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
Excellent Utility !!

I have now rebuilt my own Firmware from the output of this utility, and
successfully loaded it in the Android Firmware I created
and am currently working on using the Kernel I made from the SDK, and a
Driver I had found that loads the firmware directly
from a file. I will now begin to modify the driver sources to work
similarly and load the firmware directly from a text based file
as does the driver I located ( this driver came from an N821 Tablet
Firmware).

In order to make the output work I had to do some comparisons to the driver
supplied firmware.h files until I located several
that were extremely similar. I also did multiple pulls of the running tab
firmware and did comparisons between them.

The pulled firmwares did have differences on each instance it was pulled, I
took those to be in memory pages used for
something other than the static firmware and pretty much just removed all
of the variable sections.

Using the firmware.h file compares I used the 2 most similar ones and did
some edits to reorder the data to the same
order used in the firmware.h files, then in sections present in All of the
firmware.h files but not present in the pulled
data I simply inserted the data from the ones most similar (all seemed to
use the same data with 2 variants thus my 2
file setups). Both outputs worked with minor differences and I now have a
fully functional Firmware rebuild.

I will next compile the SDK supplied driver using my rebuilt firmware and
test that then begin modifications to make the driver
load the Firmware from a file. If I am successful I would like to package
your utility Giving Proper Credits) with the Final Rom
I produce in order to allow users to pull the data from their own Stock tab
for use with the driver. This Rom will be intended
to work on many Tablet models with minor patching which is the reason I
have spent so much effort making this Driver .

Again Thank You Excellent creative Work !!
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Blake Gripling
2015-05-27 08:56:15 UTC
Permalink
Post by Sergio Costas
I created a firmware extractor for these chips. Hope it is useful.
* Sometimes it fails in the first launch, but launching again with
exactly the same parameters works fine.
* Try to unload the touch module before running it, to avoid
interferences between both codes.
* Try first with a chunk size of 4 bytes, and change only to 2 or 1 if
it fails.
--
Nos leemos
RASTER (Linux user #228804)
Thank you thank you thank you so much for the tool! You're a real hero with
this one, as my friend David Bentley and I were looking for a similar
utility to no avail. It would sure help with aiding development for both
vanilla Linux and Android users such as myself who are into making and
editing custom ROMs.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...