Project

General

Profile

Actions

Feature #1882

closed

Replicant based on mainline Linux for Midas boards

Added by Joonas Kylmälä over 6 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Linux
Start date:
06/05/2018
Due date:
% Done:

0%

Estimated time:
Upstream patch status:
Patches review started
Grant:
Type of work:

Description

Forkbomb, Wolfie and many others have been working on mainlining the kernel for Midas boards (Samsung Galaxy S3, Note, etc.). We want to have Replicant running using that.

Current progress on the kernel can be seen here: https://blog.forkwhiletrue.me/pages/midas-mainline/

Putti/Joonas is making it work with the latest AOSP master branch. So far it boots and graphics & touch work. After the devices work with AOSP master (maybe weeks, months or years) the work needs to be rebased to the latest LineageOS version. Then the binaries need to be removed and Replicant artwork added.

Current development version can be downloaded with this command:

repo init -u git://git.putti.eu/aosp/manifest_i9305.git -b master

Actions #1

Updated by Joonas Kylmälä over 6 years ago

  • % Done changed from 0 to 10

Graphics work now and the operating system works now, too but it is really slow. I decided now to start publishing sources, so here you can download the kernel I used: :aosp/kernel_i9305.git. To compile it just do "ARCH=arm make midas_defconfig && ARCH=arm CROSS_COMPILE=arm-none-eabi- make zImage dtbs". With "cat arch/arm/boot/zImage arch/arm/boot/dts/exynos4412-i9305.dtb > kernel.img" you are able to append the device tree to the kernel and the image can be then used with AOSP. More repositories coming tomorrow!

Actions #2

Updated by Joonas Kylmälä over 6 years ago

Here is my little fork of hardware/libhardware: :aosp/libhardware. The change is that the hwcomposer.default now implements some dummy functions that are needed to support framebuffers (/dev/graphics/fb0). In the long run I will try to get the drm_hwcomposer working with the phone.

I also sent today a feature request "ARMv7-A architecture support" to SwiftShader and I got these instructions back on implementing support for SDIV/UDIV:

The Subzero JIT compiler that we're using for ARMv7 does have support for emulating division (see TargetARM32::genTargetHelperCallFor), which as far as I can tell would require two changes to use it: in Nucleus::Nucleus(), set the target instruction set to Ice::ARM32InstructionSet_Neon instead of Ice::ARM32InstructionSet_HWDivArm, and secondly sw::relocateSymbol would have to support R_ARM_CALL relocations and resolve the address of the emulation functions."

Does someone want to try implementing the emulation as described so that less patches in the kernel would be needed if we end up using SwiftShader?

Actions #3

Updated by Joonas Kylmälä over 6 years ago

I started writing the i9305 device tree from scratch soo it took me a bit longer to release the source code but here it is: git://git.putti.eu/aosp/device_i9305.git. If you want to compile an image that can be run on your i9305 phone just do the usual "repo init -u git://git.putti.eu/aosp/manifest_i9305.git -b master" and then follow the instructions on device/putti/i9305/README.md

Oh yeah, I didn't get around writing a manifest file yet to this rewrite so graphics won't work. I'm gonna be busy the next couple of weeks so maybe someone else wants to write it? The fstab also needs some work, and could those dozen hal packages be removed? Patches welcome.

Actions #4

Updated by Joonas Kylmälä over 6 years ago

I created now a minimal manifest.xml file that makes the device boot and graphics work! Just do "repo sync" to get the new device tree.

Actions #5

Updated by Joonas Kylmälä over 6 years ago

Next goal is DRM graphics (instead of current framebuffer). Can someone confirm me that https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer is the right code repository to use for it?

Actions #6

Updated by Joonas Kylmälä over 6 years ago

  • Description updated (diff)
Actions #7

Updated by Joonas Kylmälä over 6 years ago

I stumbled upon this issue after updating AOSP source code (repo sync):

build/make/core/base_rules.mk:265: error: device/putti/i9305-kernel/linux/drivers/staging/greybus/tools: MODULE.TARGET.EXECUTABLES.gb_loopback_test already defined by device/putti/i9305-kernel/drivers/staging/greybus/tools.

Looks the same as reported here: https://discuss.96boards.org/t/building-aosp-for-db410c-and-hikey960/5275). I moved now the kernel out of AOSP source code tree as a temporary fix, and so if you want to compile the OS image yourself you need to do the same.

Actions #8

Updated by Denis 'GNUtoo' Carikli almost 6 years ago

I've added a link to this bugreport on this wiki page: Upstream

Actions #9

Updated by Joonas Kylmälä almost 6 years ago

The kernel error

build/make/core/base_rules.mk:265: error: device/putti/i9305-kernel/linux/drivers/staging/greybus/tools: MODULE.TARGET.EXECUTABLES.gb_loopback_test already defined by device/putti/i9305-kernel/drivers/staging/greybus/tools.

is now fixed in the AOSP 9.0.0_r33 release!

Actions #10

Updated by Joonas Kylmälä almost 6 years ago

I'm now back working on this but this time with DRM graphics. I noticed that the DRM exynos driver doesn't support the android native abgr8888 pixel format so that needs to be added to the driver most likely. So maybe a patch like this but for Exynos: https://patchwork.kernel.org/patch/9168043/

Actions #11

Updated by Joonas Kylmälä over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 10 to 0
Actions #12

Updated by Kurtis Hanna over 4 years ago

not sure if this patch is needed or helpful, but wolfgang tried to submit it to mainline and it wasn't accepted because he didn't have u-boot running and i don't see any links to it on our wiki or this issue, unless I missed it somehow: https://patchwork.kernel.org/patch/9345815/

Actions #14

Updated by Denis 'GNUtoo' Carikli over 4 years ago

  • Project changed from Replicant to Upstreaming patches
  • Target version deleted (Any version)
  • Upstream patch status set to Work not started
Actions #15

Updated by Denis 'GNUtoo' Carikli over 4 years ago

  • Upstream patch status changed from Work not started to Patches review started
Actions #16

Updated by Denis 'GNUtoo' Carikli 7 months ago

  • Target version set to Replicant 11.0
Actions #17

Updated by Denis 'GNUtoo' Carikli 7 months ago

  • Category set to Linux
Actions

Also available in: Atom PDF