-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebase with latest 5.4 kernel? #1
Comments
Hi.
Oh, if i,m remember - only dts needed to working for mainline. But if you
need charger - need make some patches to kernel - if you try compare (make
diff) my kernel with clean kernel (with version as my) you see all my
changes and try patch new 5.4. all working besides sound - no working
Yamaha drivers... Dtb need append to kernel and using my u-boot to load...
пт, 13 дек. 2019 г., 20:38 Jonas Heinrich <[email protected]>:
… Hey,
thank you for this great work, this looks really interesting. Currently
I'm running PostmarketOS on my Samsung i9100 but with Kernel 3.0. I'm
looking into flashing a more recent kernel and also trying out ArchLinuxARM
on the phone (someone already managed it but it was some time ago
<https://archlinuxarm.org/forum/viewtopic.php?f=27&t=5284>).
What changes do I have to make to mainline sources in order to get it
running with u-boot and everything?
Thanks and best regards
Jonas
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ABNCP5AAPBGYBUBQBJD66TTQYPCDFA5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IAMKUUA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCP5E3LS3MDVOSJ536LMLQYPCDFANCNFSM4J2ROBWA>
.
|
Hey,
So far, this works fine and I have the Compiling u-boot doesn't seem to work yet:
make gives me the error:
Is it possible to also use the latest uboot version? And how do I use heimdall? Flashing u-boot should be done like this, I guess:
And the boot.img kernel from above like this?
Further I would like to boot ArchLinuxARM on the rootfs, this might work since odroid-x is similar to Samsung Galaxy S2 (?, https://archlinuxarm.org/platforms/armv7/samsung/odroid-x) http://os.archlinuxarm.org/os/ArchLinuxARM-odroid-x-latest.tar.gz Otherwise I could try a generic armv7h base system. I guess @nullie already booted ArchLinuxARM on Samsung Galaxy S2, maybe he could help out on how to use it :) |
ping @nullie |
Hi, it was ages ago, I don't remember any details |
Okay got it working, compiling the old u-boot on latest ArchLinux like this:
Let's see if I could boot the latest Linux kernel with this :) |
So I did following:
The custom u-boot works fine so far! Using the Linux kernel boot.img from your sources, I get further and two penguins show up and a cursor is blinking. I guess I have to look where I can find the boot parameters and I would like to boot an OS from internal mmc if thats possible. Is it a big work to port this custom uboot galaxys2 profile to the newest uboot version? I have looked into the source code and uboot changed a lot so I'm not sure. Maybe @astarasikov or @Talustus still know ;) |
Maybe need logs redirect to lcd - tty1 in cmdline.. later i'm try find
proper manual for build kernel image
пн, 16 дек. 2019 г., 0:43 Jonas Heinrich <[email protected]>:
… So I did following:
heimdall flash --KERNEL u-boot.bin
heimdall flash --RECOVERY uImage
The custom u-boot works fine so far! And now it stuck at "Starting kernel
...". It's not very verbose from there on. I have to look where I can find
the boot parameters and I would like to boot an OS from internal mmc if
thats possible.
Is it a big work to port this custom uboot galaxys2 profile to the newest
uboot version? I have looked into the source code and uboot changed a lot
so I'm not sure. Maybe @astarasikov <https://github.com/astarasikov> or
@Talustus <https://github.com/Talustus> still know ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ABNCP5HNSQVIGQMKSAJ5B7DQY2QIHA5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG5C6FA#issuecomment-565849876>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCP5E3J4DSKUWU4VN5MBDQY2QIHANCNFSM4J2ROBWA>
.
|
Internal emmc parted to many partitions. Internal sdcard - mmcblk0p11 as
i'm remember. You need check 11 partition - if this real internal sdcard -
format this to ext4 and extract rootfs to this partition and use this
partition in cmdline.
For debuging - you need find or hand made jig-uart cable - find in internet
how make this (need resistor 619kohm - i'm dont remeber )
вт, 17 дек. 2019 г., 14:46 Jonas Heinrich <[email protected]>:
… I got a bit further, having output on the screen :) Unfortunately there
seems to be an issue trying to mount the emmc (sdcard) and booting Linux:
[image: image]
<https://user-images.githubusercontent.com/757752/70992373-d3abfa00-20c9-11ea-8e94-408a1c9ccd88.png>
I'm using following U-Boot parameters:
"galaxy_boot=" \
/*"setenv verify n; "*/ \
"setenv loadaddr 0x4EE08000; " \
/*"setenv dev_extras console=tty0 --no-log lpj=3981312; "*/ \
"setenv dev_extras console=tty0 lpj=3981312; " \
"mmc rescan; " \
"echo Regular boot; " \
"run boot_android;\0 " \
\
and
"boot_android=" \
/* "setenv android_cmd loglevel=4 console=ram sec_debug.enable=0 " \ */ \
"setenv android_cmd loglevel=4 console=ttyS0,115200n8 console=tty0 sec_debug.enable=0 " \
"sec_debug.enable_user=0 ***@***.*** " \
"s3cfb.bootloaderfb=0x5ec00000 ld9040.get_lcdtype=0x2 " \
"consoleblank=0 lpj=3981312 vmalloc=144m " \
"root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait init=/sbin/init ;" \
"if test $sgs2_bootmode_val -eq 1; then "\
"setenv android_cmd ${android_cmd} bootmode=2; " \
"fi ;" \
"mmc dev 0; " \
"mmc read ${loadaddr} 0x16000 0x4000; " \
"setenv bootargs ${android_cmd}; "\
"echo Command Line: ${bootargs}; " \
"bootm ${loadaddr}\0" \
\
Unfortunately I have no serial/uart connection, so debbing is a bit hard.
Not sure how to solve this yet ...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ABNCP5HA52BT3TJEJI5ODI3QZC3YLA5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHCDQ4A#issuecomment-566507632>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCP5HKAHZYSMTD634NTI3QZC3YLANCNFSM4J2ROBWA>
.
|
Thanks that was a good hint! It is finally booting now but I used mmcblk1p1 with rootwait parameter :) ArchLinux is running! Now I'm trying to figure out how to connect to the device. Usb serial is somehow not working (nothing shows up in minicom). Also tried to enable CONFIG_USB_ETH, writing Maybe I could try it with wifi? I read here that I have to load firmware files with dhd, is this still correct? https://archlinuxarm.org/forum/viewtopic.php?f=27&t=5284 Anyway thank you for the support so far! |
No - mainline kernel dont have dhd driver but have brcmfmac.
There manual -
https://forum.xda-developers.com/galaxy-s2/general/port-run-mainline-linux-kernel-t3901190
ср, 18 дек. 2019 г., 1:15 Jonas Heinrich <[email protected]>:
… Thanks that was a good hint! It is finally booting now but I used
mmcblk1p1 with rootwait parameter :)
Now I'm trying to figure out how to connect to the device. Usb serial is
somehow not working (nothing shows up in minicom). Also tried to enable
CONFIG_USB_ETH, writing g_ether into /etc/modules-load.d/gether.conf and options
g_ether host_addr=12:a5:cf:42:92:fd dev_addr=5e:bc:ca:27:92:b1
idVendor=1317 idProduct=42146 into /etc/modprobe.d/g_ether.conf but at
startup I can only read module-load failed :(
Maybe I could try it with wifi? I read here that I have to load firmware
files with dhd, is this still correct?
https://archlinuxarm.org/forum/viewtopic.php?f=27&t=5284
Anyway thank you for the support so far!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ABNCP5FJTMHO4FDPPOJOPFTQZFFPVA5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHEENPI#issuecomment-566773437>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCP5HIIVUJLVZRQSXFCP3QZFFPVANCNFSM4J2ROBWA>
.
|
For working usb-uart - need working max8997 driver - but in mainline i'm
find that his not working normal - no irq's and no reaction on plug-unplug
cable. I'm try find fix - and find patches for porting current irq to irq
map for this chip -
https://patchwork.kernel.org/patch/9182567/
But this not all patches - you need find all in this line - in my link
patch have number 7/2 - you need find other (from 7/1 to 7/7 - 7 patches)
and try patch.
ср, 18 дек. 2019 г., 7:13 Evgen Stenkin <[email protected]>:
… No - mainline kernel dont have dhd driver but have brcmfmac.
There manual -
https://forum.xda-developers.com/galaxy-s2/general/port-run-mainline-linux-kernel-t3901190
ср, 18 дек. 2019 г., 1:15 Jonas Heinrich ***@***.***>:
> Thanks that was a good hint! It is finally booting now but I used
> mmcblk1p1 with rootwait parameter :)
> Now I'm trying to figure out how to connect to the device. Usb serial is
> somehow not working (nothing shows up in minicom). Also tried to enable
> CONFIG_USB_ETH, writing g_ether into /etc/modules-load.d/gether.conf and options
> g_ether host_addr=12:a5:cf:42:92:fd dev_addr=5e:bc:ca:27:92:b1
> idVendor=1317 idProduct=42146 into /etc/modprobe.d/g_ether.conf but at
> startup I can only read module-load failed :(
>
> Maybe I could try it with wifi? I read here that I have to load firmware
> files with dhd, is this still correct?
> https://archlinuxarm.org/forum/viewtopic.php?f=27&t=5284
>
> Anyway thank you for the support so far!
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#1?email_source=notifications&email_token=ABNCP5FJTMHO4FDPPOJOPFTQZFFPVA5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHEENPI#issuecomment-566773437>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABNCP5HIIVUJLVZRQSXFCP3QZFFPVANCNFSM4J2ROBWA>
> .
>
|
@Sekilsgs2 thanks for the info. I skipped the usb networking/serial part and plugged in an usb keyboard with usb-otg. It is working fine and I can now access the phone :) Now I'm trying to get wifi working but dmesg tells bluetooth is working after I downloaded |
You need firmware from stock fw and not from linux repo
ср, 18 дек. 2019 г., 10:45 Jonas Heinrich <[email protected]>:
… @Sekilsgs2 <https://github.com/Sekilsgs2> thanks for the info. I skipped
the usb networking/serial part and plugged in an usb keyboard with usb-otg.
It is working fine and I can now access the phone :)
Now I'm trying to get wifi working but ip a doesn't show me any device
yet. I downloaded this nvram txt file
<https://raw.githubusercontent.com/TheMuppets/proprietary_vendor_samsung/cm-14.1/i9100/proprietary/system/etc/wifi/nvram_net.txt>
and copied it to
/usr/lib/firmware/brcm/brcmfmac4330-sdio.samsung,i9100.txt since brcmfmac
was asking for it. lsmod shows that brcmfmac is loaded. dmesg has no
further errors but also doesn't show any activity regarding a wifi device
:( The package linux-firmware is providing the file brcmfmac4330-sdio.bin
in ArchLinuxArm.
dmesg tells bluetooth is working after I downloaded BCM4330B1.hcd and
copied it to /usr/lib/firmware/brcm.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=ABNCP5GGVFRRFI2HMX5J5IDQZHIJ3A5CNFSM4J2ROBWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHFHOMY#issuecomment-566916915>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNCP5BIW53H2CBZ73OZXTDQZHIJ3ANCNFSM4J2ROBWA>
.
|
Thanks this worked! Next step is try to use mainline kernel provided by ArchLinuxArm by supplying the dtb file. Maybe this is possible :) |
I was able to boot kernel 5.4.5 :) These are the commands I used:
It is booting so far but USB-OTG isn't working anymore so I'm unable to plug-in and use the keyboard. Not sure yet if this is due to the new kernel, unmodified patches you made or kernel configuration. I had to comment following section in
The screen output is also upside down |
@onny could you share your u-boot.bin? I'm on Debian and the process of compiling the downstream u-boot for i9100 looks like a PITA. |
@pcercuei Have a look at this older thread, you'll get precompiled images there https://forum.xda-developers.com/galaxy-s2/general/uboot-bootloader-true-multiboot-t1680898 |
No this dont have ext4 support. I'm can build but next days - now no time.. |
But why problem download from my repo compiller and compile this? |
@Sekilsgs2 the old uboot is fine; I don't need ext4, I just boot the kernel's uImage from the recovery partition. I successfully booted 5.6-rc4. It went relatively smooth. PostmarketOS with Phosh is working. 3D acceleration works. eUSB-ethernet works too (didn't try OTG). Next on my list is WiFi / bluetooth. |
@pcercuei Great work, this looks really nice! I wrote an instruction for proprietary firmware files here https://wiki.postmarketos.org/wiki/Samsung_Galaxy_SII_(samsung-i9100)#Firmware_files . Would be cool if we could package them for PostmarketOS and further package an i9100-linux mainline kernel |
@onny will give it a try, thanks. About the screen being backwards: on postmarketOS' UI, press power to turn off the screen, then turn it on again, and the rotation is gone. Strange. But then the UI is usable with the touchscreen. |
@Sekilsgs2, @onny - I'm going to try to send the i9100's devicetree file upstream. I cleaned it a bit so that the DT maintainer will be happy. Some things have been tweaked too, e.g. the LDO13 regulator is now 3.0V instead of 3.3V. Here's the future patchset: torvalds/linux@v5.6-rc5...OpenDingux:for-upstream-i9100 Did you modify parts of it? If so I'll need you to sign the patchset as well since you have a copyright. |
Yes - this dt my work. What need? |
Updated the patchset: torvalds/linux@v5.6-rc5...OpenDingux:for-upstream-i9100 I set you as the devicetree patch's author, added your copyright in the file's header, and added: If you're OK I'll submit it later today. |
Yes - all good. |
How can I boot it without u-boot? |
Good question :) I'm think no way or i'm dont know |
The original i9100 v3.0 kernel that comes with PostmarketOS is flashed to the KERNEL partition, and has the initramfs in RECOVERY. I want to do the same, but it looks like that right now the upstream kernel can only start using u-boot. |
It's the same with Galaxy S III mini: https://wiki.postmarketos.org/wiki/Samsung_Galaxy_S_III_mini_(samsung-golden)#Installation
|
I think we need u-boot + Linux flashed to the KERNEL partition (Linux flashed at an offset that u-boot reads from). Then it would work with PostmarketOS. |
Looks like the devicetree was accepted upstream :) Another issue I noticed: with the mainline kernel the contrast on the display is terrible. The black is not black, but grey. |
Thank :) |
Btw back in 2012/2013 I tried getting I9100 to work with the upstream kernel (Linaro 3.3 at the moment). I ported the sound driver (look above) and made it work somehow without Android userspace (at least for the speaker/headphones part for music), although good luck getting that one upstreamed. I also enabled the camera (FIMC) with open-source upstream drivers but never managed to confirm it works because there were no userspace apps that supported videobuf2 API back then. For the phone part (if you're interested), I've added all the necessary changes to Replicant's "libsamsung-ril" so there is open-source userspace/RIL at least for Android. I have not however managed to get ofono or other non-Android stacks to work back then. If you're interested in sound and camera, check out this post by Replicant developers. They got the sound driver to work without hacking the driver, but only for Android. The links from the blog post have expired but here are some mirrors. P.S. for booting without u-boot, Linux has two options: concatenated DTB and hardcoding command line into the kernel config (so that it does not use the one from the bootloader). |
I did write a few codec and sound drivers, so I can have a look at this one. Not promising anything. Having support for the camera would be great, too. I did not look that much into it, but I know the two sensors are supported by the upstream kernel. The problem for booting without u-boot is that Samsung's sboot starts its payload with the MMU enabled and caches not reset, and Linux is not able to cope with that without a patch that was not accepted upstream. |
For the MMU issue you can just prepend some stub code before the zImage (to
the binary so that you don't have to patch Linux code) which will disable
MMU (without corrupting registers, or you can even make it override
registers).
This way it's possible to use upstream kernel tree. This patching can be
made part of platform-specific firmware update code.
Here's how I did it in the past to override MTYPE on a Tegra board
https://github.com/astarasikov/mkbootimg-mtype-hacked/blob/master/mkbootimg.c#L103
For the sound codec, you can try porting the mc1n2 codec and then using the
alsa controls as described in my mail below:
https://www.mail-archive.com/[email protected]/msg02865.html
…On Sun, 12 Apr 2020, 14:19 Paul Cercueil, ***@***.***> wrote:
I did write a few codec and sound drivers, so I can have a look at this
one. Not promising anything.
Having support for the camera would be great, too. I did not look that
much into it, but I know the two sensors are supported by the upstream
kernel.
The problem for booting without u-boot is that Samsung's sboot starts its
payload with the MMU enabled and caches not reset, and Linux is not able to
cope with that without a patch that was not accepted upstream.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGNWSVHNYT2WNAYRDB3DZTRMGWUBANCNFSM4J2ROBWA>
.
|
could you please fix the missing git history? thx |
Wow that's great, the device tree for this device is upstream now :D Thanks @pcercuei @Sekilsgs2 |
No.. im work on pc without commiting history and simple load all files to git. You can make diff with stock and my to see differents. |
Hi people. sorry for suddenly question post.. Hexagonwin |
Last time I tested it the display was upside-down, yes. I don't remember if sound works. WiFi / Bluetooth probably work, I didn't test them last time as I didn't have the firmware files. |
On this kernel - lcd working normal - without any rotations - maybe mainline have such problems- dont know.. |
Then things like RIL and Sound not working? |
Hey,
thank you for this great work, this looks really interesting. Currently I'm running PostmarketOS on my Samsung i9100 but with Kernel 3.0. I'm looking into flashing a more recent kernel and also trying out ArchLinuxARM on the phone (someone already managed it but it was some time ago).
What changes do I have to make to mainline sources in order to get it running with u-boot and everything?
Thanks and best regards
Jonas
The text was updated successfully, but these errors were encountered: