Project

General

Profile

Actions

Issue #2143

open

Create and upstream a dts for the I9100G

Added by Denis 'GNUtoo' Carikli over 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Linux
Target version:
-
Start date:
10/13/2020
Due date:
% Done:

0%

Estimated time:
Upstream patch status:
Work not started
Grant:
Type of work:
C programming
Actions #1

Updated by Denis 'GNUtoo' Carikli over 3 years ago

The GT-I9100G is not supported yet by Replicant. To add support for it without too much work, it would be best to use an upstream kernel to leverage all the work that is being done for Replicant 10 and onward.

Kernel git: https://github.com/LineageOS/android_kernel_samsung_t1
configuration: https://github.com/LineageOS/android_kernel_samsung_t1/blob/cm-11.0/arch/arm/configs/cyanogenmod_i9100g_defconfig

This kernel also supports other OMAP4 boards, for instance:
  • the OMAP4 SDP (board-4430sdp.c and other files)
  • the Pandaboard (board-omap4panda.c and other files)

So if the code for the OMAP4 SDP or the Pandaboard is similar to GT-I9100G in this kernel, we could then simply copy/paste part of the devicetree of the Pandaboard or OMAP4 SDP to do a big part of the work.

To do that we need for each device to start by identifying the defconfig corresponding to the device.

For instance here CyanogenMod used cyanogenmod_i9100g_defconfig, so we can start with that.

In https://github.com/LineageOS/android_kernel_samsung_t1/blob/cm-11.0/arch/arm/configs/cyanogenmod_i9100g_defconfig, we can see CONFIG_MACH_SAMSUNG_T1=y. The Pandaboard uses CONFIG_MACH_OMAP4_PANDA istead for instance.

So with that we can look at the files being compiled in in https://github.com/LineageOS/android_kernel_samsung_t1/blob/cm-11.0/arch/arm/mach-omap2/Makefile when CONFIG_MACH_SAMSUNG_T1 is y.

So with the Pandaboard we have:
obj-$(CONFIG_MACH_OMAP4_PANDA)        += board-omap4panda.o \
                       hsmmc.o \
                       omap_phy_internal.o

16:10 <@GNUtoo> Especially the stuff in
So all the files we need to look are at:
  • board-omap4panda.c
  • hsmmc.c
  • omap_phy_internal.c

For the GT-I9100G it's not in that Makefile but this one: https://github.com/LineageOS/android_kernel_samsung_t1/blob/cm-11.0/arch/arm/mach-omap2/Makefile.sec

So we have:

obj-$(CONFIG_MACH_SAMSUNG_T1)        += board-t1.o \
                       board-t1-emif.o \https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/omap4-sdp.dts
                       board-t1-wifi.o \16:10 <@GNUtoo> Especially the stuff in 
                       board-t1-display.o \
                       board-t1-connector.o \
                       board-t1-power.o \
                       board-t1-pmic.o \
                       board-t1-serial.o \
                       board-t1-jack.o \
                       board-t1-input.o \
                       board-t1-sensors.o\
                       board-t1-modems.o\
                       board-t1-sdio.o \
                       board-t1-bluetooth.o \
                       board-t1-vibrator.o \
                       board-t1-fmradio.o \
                       board-t1-camera.o

obj-$(CONFIG_MACH_SAMSUNG_T1)        += board-t1-muxset-r02.o \
                       board-t1-muxset-r03.o \
                       board-t1-muxset-r04.o \
                       board-t1-muxset-r05.o \
                       board-t1-muxset-r07.o

So we need to look in all the corresponding C files.

Theses C files contain configuration data for some of the drivers.

So for instance the driver for the SD card controller needs to know if there is a pin dedicated to detect the card insertion or not.

Here theses C files have that information. If the information is the same in the case of the Pandaboard and the GT-I9100, we can copy that part of the devicetree of the Pandaboard.

Theses files also have information on how the system on a chip pins are configured. This seems to be in static struct omap_board_mux board_mux[] __initdata = { here.

So we need to look if they are similar.

Then once we know what is similar we can copy the information from the various devicetree files:

Knowledge

Once this is done you will need to try the result on the smartphone, so you need to have one, and you might need to make a cable to get very early boot logs.

Once that is done, you need to read the documentation on how to send a patch to the Linux kernel and send it there (you can add the Replicant mailing list in CC or send it to the Replicant mailing list before if you're unsure of your patch and you want some prior review).

Next steps

This device has the same display as the GT-I9100, so it would be a good idea to try to make the display work too. That however will probably require to dig into more details on how the hardware work, and understand more what you are doing.

Modifications to this document:
  • version 0: copy-pasted IRC logs
  • version 1: rewrote most of it to add more structure to it
Actions #2

Updated by _I3^ RELATIVISM about 3 years ago

  • Type of work C programming added
Actions #3

Updated by Denis 'GNUtoo' Carikli over 2 years ago

  • Category set to Linux
Actions

Also available in: Atom PDF