This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building from Source
#11
Just realised as well I should have read the site's wiki page, Doh!

https://tinkerboarding.co.uk/wiki/index....are#U-boot

How to compile U-Boot and Android_kernel for the TB.
Reply
#12
Update:  Don't use the 5.4.1 release. Removed my former post.

@Locke: Yes you will need the whole source code from Asus. I tried last weeks to port LineageOS, but without the vendors source code it is a long long way to go.
Reply
#13
(10-09-2017, 03:29 PM)lobo Wrote: Update:  Don't use the 5.4.1 release. Removed my former post.

@Locke: Yes you will need the whole source code from Asus. I tried last weeks to port LineageOS, but without the vendors source code it is a long long way to go.

Okay then i will try to get up on a level where i can be a support to get to this goal a bit closer.
Do you have any suggestions where i should start or beginn with the journey?
Maybe with the AOSP ?

Thanks and Greets
Reply
#14
You can take a look here: https://fat-tire.github.io/porting-intro.html

And also here: https://forum.xda-developers.com/chef-ce...1-t3551484
Reply
#15
(10-09-2017, 05:11 PM)lobo Wrote: You can take a look here: https://fat-tire.github.io/porting-intro.html

And also here: https://forum.xda-developers.com/chef-ce...1-t3551484

Thank You Lobo,
im already working on this tutorials.

one additional question, do you have an idea how we could easily built a custom recovery for the TB ?, i would prefer TWRP.

Greets
Reply
#16
No sorry, I tried with the LineageOS, it compiles, it boots, but the graphical interface don't come up. I don't have so much time to investigate this further, so I stopped it at this point.
But if you want to try, here are my device/rockchip/rk3288 files. The kernel need to be there precompiled, as I didn't managed to make it compile by building the lineage os. If you want to compile Nougart, the kernel need to be patched. I replaced the whole security/selinux folder from the last 3.10 kernel sources to make the selinux compatible. You'll need some proprietary files from the TinkerBoard. These you find in folders vendor and lib/egl and lib/hw on the system partition. The hwcomposer.rk30board.so loads the libGLES library only if system property rk.soc.name is set to rk3288 as you see in device_3288.mk.

Once you made it compile, the system.img is not compatible to flash to the TinkerBoard. I used the mksystemimg.sh and mkbootimg.sh for that.


Attached Files
.zip   device_rockchip.zip (Size: 36.71 KB / Downloads: 16)
Reply
#17
(10-04-2017, 07:15 PM)lobo Wrote: Yes, I also would like to have the whole source code. Hopefully Asus will publish soon.
But to change hdmi resolution it is not needed the android source code. I spent a lot of the last days to go through the rockchip hdmi kernel driver source code. The default resolution the driver uses, can be modified in drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c. Yesterday I found the right timings for my 1280x800 7" display, that is connected via a M.NT68676 hdmi adapter board:
Code:
    {
        .mode = {
            .name = "1280x800p@60hz",
            .refresh = 60,
            .xres = 1280,
            .yres = 800,
            .pixclock = 85000000,
            .left_margin = 200,
            .right_margin = 72,
            .upper_margin = 22,
            .lower_margin = 3,
            .hsync_len = 128,
            .vsync_len = 6,
            .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
            .vmode = 0,
            .flag = 0,
        },
        .vic = HDMI_VIDEO_DMT | 11,  //512 | 11 = 523
        .vic_2nd = 0,
        .pixelrepeat = 1,
        .interface = OUT_P888,
    },

And in rockchip-hdmi.h can be set the default mode.
Code:
/* HDMI default vide mode */
#define HDMI_VIDEO_DEFAULT_MODE            523 //1280x800

But this is not everything. The android window manager always uses the resolution 1920x1080. This works, but is not nice! Letters and symbols are very small. Don't work 'wm size 1280x800'. This produces misalignment of the touch panel area, for example in the center the touch is o.k. but the wider to the edge the bigger the misalignment. Or the 'wm density' causes cut symbols. The trick is, how to make the window manager use the physical resolution of your lcd display. First I thought it is inside the android code, but it is not. To find this, cost me several days.
In the device tree, in section rk_screen also is needed to definethe correct timings (rk3288-miniarm.dts):
Code:
/*Use own rk_screen config
#include "lcd-asus.dtsi"*/
.
.
.
&rk_screen {
    display-timings = <&disp_timings>;
    disp_timings: display-timings {
        native-mode = <&timing2>;
        timing0: timing0 {
            screen-type = <SCREEN_MIPI>;
            out-face  = <OUT_P888>;
            clock-frequency = <28488600>;
            hactive = <800>;
            vactive = <480>;
            hback-porch = <26>;
            hfront-porch = <85>;
            vback-porch = <21>;
            vfront-porch = <7>;
            hsync-len = <20>;
            vsync-len = <2>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing1: timing1 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <74250000>;
            hactive = <1024>;
            vactive = <600>;
            hback-porch = <160>;
            hfront-porch = <24>;
            vback-porch = <29>;
            vfront-porch = <3>;
            hsync-len = <136>;
            vsync-len = <6>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing2: timing2 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <83500000>;
            hactive = <1280>;
            vactive = <800>;
            hback-porch = <200>;
            hfront-porch = <72>;
            vback-porch = <22>;
            vfront-porch = <3>;
            hsync-len = <128>;
            vsync-len = <6>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing3: timing3 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <148500000>;
            hactive = <1920>;
            vactive = <1080>;
            hback-porch = <148>;
            hfront-porch = <88>;
            vback-porch = <36>;
            vfront-porch = <4>;
            hsync-len = <44>;
            vsync-len = <5>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
    };
};


With this setting, the native-mode points to the 1280x800 timing, the framebuffer is initialized to this resolution. And this makes the window manager also use this resolution as physical resolution. Finally I changed the density from 240 to 180.

Big Grin Thank you Lobo, Not only have i managed to compile from the source and fix the hdmi display not turning on from power on, but in following your instructions have fixed my screen resolution issues.
Your display timings, I actually placed them in "arch/arm/boot/dts/lcd-asus.dtsi" instead, as per below. It compiles without error and boots with the correct resolution when a EDID table is not received. Ill have a look at uBoot as well as it could be useful to do similar.
Code:
/*
* Asus tinker board LCD BOX
*/

/ {
    ............
        disp_timings: display-timings {
                    num_timings = <4>;
                    native-mode = <&timing1>;
                    compatible = "rockchip,display-timings";
                    timing0: timing0 {
                        screen-type = <SCREEN_MIPI>;
                        out-face  = <OUT_P888>;
                        clock-frequency = <28488600>;
                        hactive = <800>;
                        vactive = <480>;
                        hback-porch = <26>;
                        hfront-porch = <85>;
                        vback-porch = <21>;
                        vfront-porch = <7>;
                        hsync-len = <20>;
                        vsync-len = <2>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing1: timing1 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <74250000>;
                        hactive = <1024>;
                        vactive = <600>;
                        hback-porch = <160>;
                        hfront-porch = <24>;
                        vback-porch = <29>;
                        vfront-porch = <3>;
                        hsync-len = <136>;
                        vsync-len = <6>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing2: timing2 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <83500000>;
                        hactive = <1280>;
                        vactive = <800>;
                        hback-porch = <200>;
                        hfront-porch = <72>;
                        vback-porch = <22>;
                        vfront-porch = <3>;
                        hsync-len = <128>;
                        vsync-len = <6>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing3: timing3 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <148500000>;
                        hactive = <1920>;
                        vactive = <1080>;
                        hback-porch = <148>;
                        hfront-porch = <88>;
                        vback-porch = <36>;
                        vfront-porch = <4>;
                        hsync-len = <44>;
                        vsync-len = <5>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    };
};
       
Reply
#18
Yes, off course it is also possible do so. Fine that it fixed your problem.
Reply
#19
(10-14-2017, 03:11 PM)lostangel556 Wrote:
(10-04-2017, 07:15 PM)lobo Wrote: Yes, I also would like to have the whole source code. Hopefully Asus will publish soon.
But to change hdmi resolution it is not needed the android source code. I spent a lot of the last days to go through the rockchip hdmi kernel driver source code. The default resolution the driver uses, can be modified in drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c. Yesterday I found the right timings for my 1280x800 7" display, that is connected via a M.NT68676 hdmi adapter board:
Code:
    {
        .mode = {
            .name = "1280x800p@60hz",
            .refresh = 60,
            .xres = 1280,
            .yres = 800,
            .pixclock = 85000000,
            .left_margin = 200,
            .right_margin = 72,
            .upper_margin = 22,
            .lower_margin = 3,
            .hsync_len = 128,
            .vsync_len = 6,
            .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
            .vmode = 0,
            .flag = 0,
        },
        .vic = HDMI_VIDEO_DMT | 11,  //512 | 11 = 523
        .vic_2nd = 0,
        .pixelrepeat = 1,
        .interface = OUT_P888,
    },

And in rockchip-hdmi.h can be set the default mode.
Code:
/* HDMI default vide mode */
#define HDMI_VIDEO_DEFAULT_MODE            523 //1280x800

But this is not everything. The android window manager always uses the resolution 1920x1080. This works, but is not nice! Letters and symbols are very small. Don't work 'wm size 1280x800'. This produces misalignment of the touch panel area, for example in the center the touch is o.k. but the wider to the edge the bigger the misalignment. Or the 'wm density' causes cut symbols. The trick is, how to make the window manager use the physical resolution of your lcd display. First I thought it is inside the android code, but it is not. To find this, cost me several days.
In the device tree, in section rk_screen also is needed to definethe correct timings (rk3288-miniarm.dts):
Code:
/*Use own rk_screen config
#include "lcd-asus.dtsi"*/
.
.
.
&rk_screen {
    display-timings = <&disp_timings>;
    disp_timings: display-timings {
        native-mode = <&timing2>;
        timing0: timing0 {
            screen-type = <SCREEN_MIPI>;
            out-face  = <OUT_P888>;
            clock-frequency = <28488600>;
            hactive = <800>;
            vactive = <480>;
            hback-porch = <26>;
            hfront-porch = <85>;
            vback-porch = <21>;
            vfront-porch = <7>;
            hsync-len = <20>;
            vsync-len = <2>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing1: timing1 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <74250000>;
            hactive = <1024>;
            vactive = <600>;
            hback-porch = <160>;
            hfront-porch = <24>;
            vback-porch = <29>;
            vfront-porch = <3>;
            hsync-len = <136>;
            vsync-len = <6>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing2: timing2 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <83500000>;
            hactive = <1280>;
            vactive = <800>;
            hback-porch = <200>;
            hfront-porch = <72>;
            vback-porch = <22>;
            vfront-porch = <3>;
            hsync-len = <128>;
            vsync-len = <6>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
        timing3: timing3 {
            screen-type = <SCREEN_RGB>;
            out-face    = <OUT_P888>;
            color-mode = <COLOR_YCBCR>;
            clock-frequency = <148500000>;
            hactive = <1920>;
            vactive = <1080>;
            hback-porch = <148>;
            hfront-porch = <88>;
            vback-porch = <36>;
            vfront-porch = <4>;
            hsync-len = <44>;
            vsync-len = <5>;
            hsync-active = <1>;
            vsync-active = <1>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
    };
};


With this setting, the native-mode points to the 1280x800 timing, the framebuffer is initialized to this resolution. And this makes the window manager also use this resolution as physical resolution. Finally I changed the density from 240 to 180.

Big Grin Thank you Lobo, Not only have i managed to compile from the source and fix the hdmi display not turning on from power on, but in following your instructions have fixed my screen resolution issues.
Your display timings, I actually placed them in "arch/arm/boot/dts/lcd-asus.dtsi" instead, as per below. It compiles without error and boots with the correct resolution when a EDID table is not received. Ill have a look at uBoot as well as it could be useful to do similar.
Code:
/*
* Asus tinker board LCD BOX
*/

/ {
    ............
        disp_timings: display-timings {
                    num_timings = <4>;
                    native-mode = <&timing1>;
                    compatible = "rockchip,display-timings";
                    timing0: timing0 {
                        screen-type = <SCREEN_MIPI>;
                        out-face  = <OUT_P888>;
                        clock-frequency = <28488600>;
                        hactive = <800>;
                        vactive = <480>;
                        hback-porch = <26>;
                        hfront-porch = <85>;
                        vback-porch = <21>;
                        vfront-porch = <7>;
                        hsync-len = <20>;
                        vsync-len = <2>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing1: timing1 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <74250000>;
                        hactive = <1024>;
                        vactive = <600>;
                        hback-porch = <160>;
                        hfront-porch = <24>;
                        vback-porch = <29>;
                        vfront-porch = <3>;
                        hsync-len = <136>;
                        vsync-len = <6>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing2: timing2 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <83500000>;
                        hactive = <1280>;
                        vactive = <800>;
                        hback-porch = <200>;
                        hfront-porch = <72>;
                        vback-porch = <22>;
                        vfront-porch = <3>;
                        hsync-len = <128>;
                        vsync-len = <6>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    timing3: timing3 {
                        screen-type = <SCREEN_RGB>;
                        out-face    = <OUT_P888>;
                        color-mode = <COLOR_YCBCR>;
                        clock-frequency = <148500000>;
                        hactive = <1920>;
                        vactive = <1080>;
                        hback-porch = <148>;
                        hfront-porch = <88>;
                        vback-porch = <36>;
                        vfront-porch = <4>;
                        hsync-len = <44>;
                        vsync-len = <5>;
                        hsync-active = <1>;
                        vsync-active = <1>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                        swap-rb = <0>;
                        swap-rg = <0>;
                        swap-gb = <0>;
                    };
                    };
};
       

Hey guys,
i bought now the 7" Wavshare (1024x600) HDMI Touch Display © and trying to do the modification as explained.
In the first step by modifying the "rockchip-hdmi-lcd-c.c file":
Did you added the code as shown or did you replaced it with an other resolution?
Additional to this did you wrote now 1280x800 or 1024x600 (like waveshare display res) and if you write 1024x600 are there any other parameters or timings to change like pixelclock margin and so on??

Okay i tried it and could compile without errors the kernel files but where are the files now (kernel.img and resource.img?)
And how to bring it now to the TB? because my actuall SD-Card where the Android of the TB is installed wont appear on my linux OS.


thx and greets
Reply
#20
Hi Locke,

try this timings in rockchip-hdmi-lcd.c instead of the 1280x800:
Code:
{
        .mode = {
            .name = "1024x600p@60hz",
            .refresh = 60,
            .xres = 1024,
            .yres = 600,
            .pixclock = 74250000,
            .left_margin = 160,
            .right_margin = 24,
            .upper_margin = 29,
            .lower_margin = 3,
            .hsync_len = 136,
            .vsync_len = 6,
            .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
            .vmode = 0,
            .flag = 0,
        },
        .vic = HDMI_VIDEO_DMT | 10,  //512 | 10 = 522
        .vic_2nd = 0,
        .pixelrepeat = 1,
        .interface = OUT_P888,
    },

This is working with my OdroidVU7+. Don't know if it works with your Waveshare, but it should.
Look at .vic value. This must not be double there. Here it is 522, that you need to put in rockchip-hdmi.h HDMI_VIDEO_DEFAULT_MODE.
This is for the video driver.

The framebuffer you set in devicetree as shown from lostangel556.

After compiling you'll find the kernel.img and resource.img in the kernel top directory.

Flashing with rkflashtool:
Code:
sudo ./rkflashtool w kernel <kernel.img
sudo ./rkflashtool w resource <resource.img

To bring the TinkerBoard into bootloader mode, put a jumper to the volume+ header and connect the otg port with your host pc.

But make a backup before flashing:

Code:
sudo ./rkflashtool r kernel >kernel-org.img
sudo ./rkflashtool r resource >resource-org.img
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)