Latest product reviews
ARCHOS 50 Diamond
ARCHOS GamePad2
ARCHOS
Smartphones
ARCHOS
TV Connect
ARCHOS 101 XS

A A A
Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?

ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288

 Please donate to support OMA and CrewRKTablets firmware work, thank you !

sp_Feed sp_TopicIcon
Kernel development Haierpad 1043 (iFive X3 / RK3188): Help with SD and wifi needed
Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
1
2016/08/21 - 14:19
sp_Permalink sp_Print

Hey guys,

after successfully porting CM11 and 12.1 to my Haier Haierpad 1043 (being a rebranded iFive X3) I am currently working on building a custom kernel (3.0.36+ for the start).
The repository is based on the great work of D33 and str90 and can be found on GitHub.

The kernel is successfully booting and basic stuff like touchpad, sensors and audio work. I am however experiencing trouble while trying to get wifi, bluetooth and external SD to work.
Communication to the wifi chip is realized via sdio so those things are closely connected to each other.

Can anyone give me a hint how to solve my problem? I am attaching a stock DMESG as well as one from my self-built kernel, furthermore an Excel-sheet containing information to GPIOs and kallsyms of stock kernel. I also managed to disassemble the stock kernel and label all the functions. Maybe someone is interested in assembler code of a particular function.

Thanks in advance for your help!

Yours,
DerFetzer

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
2
2016/08/21 - 19:56
sp_Permalink sp_Print

Hi,

seems you did not do a GPIOs dump see here link .after successful dump you need to match the GPIOs number to your board-haier-1043***.c .

The Excel-sheet containing information kallsyms of stock kernel is irrelevant at this point, it will not help you unless you know how to reversed!!. from my point of view the kernel offset is more interesting.

best luck.

Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
3
2016/08/21 - 20:04
sp_Permalink sp_Print

Hi mussonero,

thanks for your reply. Of course I did a GPIO dump but I uploaded the wrong document. In the provided Excel file you find a stock GPIO dump as well as one from my custom kernel in comparison.

Yours,
DerFetzer

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
4
2016/08/21 - 20:33
sp_Permalink sp_Print sp_EditHistory

Ok,

but i see you are not familiar with Gpios configuration from your board-haier-1043.c ,

you should clean it up and set the right Gpios like this for an example the  Bluetooth platform  data.

#ifdef CONFIG_RFKILL_RK
// bluetooth rfkill device, its driver in net/rfkill/rfkill-rk.c
static struct rfkill_rk_platform_data rfkill_rk_platdata = {
    .type               = RFKILL_TYPE_BLUETOOTH,

    .poweron_gpio       = { // BT_REG_ON
        .io             = RK30_PIN3_PC7,
        .enable         = GPIO_HIGH,
        .iomux          = {
            .name       = "bt_poweron",
            .fgpio      = GPIO3_C7,
        },
    },

    .reset_gpio         = { // BT_RST
        .io             = RK30_PIN3_PD1,
        .enable         = GPIO_LOW,
        .iomux          = {
            .name       = "bt_reset",
            .fgpio      = GPIO3_D1,
       },
   },

    .wake_gpio          = { // BT_WAKE, use to control bt's sleep and wakeup
        .io             = RK30_PIN3_PC6,
        .enable         = GPIO_HIGH,
        .iomux          = {
            .name       = "bt_wake",
            .fgpio      = GPIO3_C6,
        },
    },

    .wake_host_irq      = { // BT_HOST_WAKE, for bt wakeup host when it is in deep sleep
        .gpio           = {
            .io         = RK30_PIN0_PA5,
            .enable     = GPIO_LOW,     
            .iomux      = {
                .name   = "bt_host_wake",
                .fgpio      = GPIO0_A5,
            },
        },
    },

    .rts_gpio           = { // UART_RTS, enable or disable BT's data coming
        .io             = RK30_PIN1_PA3, // set io to INVALID_GPIO for disable it
        .enable         = GPIO_LOW,
        .iomux          = {
            .name       = "bt_rts",
            .fgpio      = GPIO1_A3,
            .fmux       = UART0_RTSN,
        },
    },
};

static struct platform_device device_rfkill_rk = {
    .name   = "rfkill_rk",
    .id     = -1,
    .dev    = {
        .platform_data = &rfkill_rk_platdata,
    },
};

#endif

you should do the rest for Wifi, Hdmi,Camera ,,,etc


Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
5
2016/08/21 - 20:41
sp_Permalink sp_Print

One more thing the GPIOs dump will not reveal for you the power state for the gpio if it is hgih or low, so you need to do "trial and error" in this case or look at another board configurations.

Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
6
2016/08/21 - 22:18
sp_Permalink sp_Print

You are right that I could tidy up the files a bit, but nevertheless I've already added the GPIO configurations where necessary.

Some information is included in separate files (e.g. SDMMC/wifi/camera). Things like touchpad, camera and sound and so on are already working.

I double and tripple checked the SDMMC GPIOs (and enable values) by comparing the dumps as well as the values inside the stock kernel. Since the internal SD controller is used there should also be no big difference to other boards using the RK3188.

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
7
2016/08/21 - 22:42
sp_Permalink sp_Print

OK , but i found that BT_RFKILL platform data was missing some info, did you corrected as i mentioned above ?. because in your dmesg  you had ,, [BT_RFKILL]: reset GPIO is invalid,,  incorrectly configured, you need to pay attentions to all dmesg output.For the Wifi you are using an older version V4.70 than the one on your stock kernel V4.72.

Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
8
2016/08/21 - 22:59
sp_Permalink sp_Print

Thanks for your hint. I apparently fixed the bluetooth invalid GPIO sometime, because it is no more present in the most recent dmesg (attached, mmc/core/core.c compiled with DEBUG flag). But I did not take a very close look at bluetooth yet. But it could be a good idea because apparently a combined wifi/bluetooth chip is used (AP6210: wifi --> sdio, bt --> uart).

I updated the wifi driver yesterday I think, but did not commit it until now. The changes were only minor and unfortunately did not bring any improvements to current state.

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
9
2016/08/21 - 23:30
sp_Permalink sp_Print

Ok, now i see your last commit , seems you have added the right values for BT, but still missing this

    .wake_host_irq      = { // BT_HOST_WAKE, for bt wakeup host when it is in deep sleep
        .gpio           = {
            .io         = RK30_PIN0_PA5,
            .enable     = GPIO_LOW,     
            .iomux      = {
                .name   = "bt_host_wake",
                .fgpio      = GPIO0_A5, // this one missing
            },
        },
    }

Another thing for #define RK29SDK_SD_CARD_DETECT_N RK30_PIN3_PB0.

I think it should be #define RK29SDK_SD_CARD_DETECT_N RK30_PIN3_PC0

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
10
2016/08/21 - 23:44
sp_Permalink sp_Print

Could you check this too?

#define RK30SDK_WIFI_GPIO_WIFI_INT_B     RK30_PIN3_PD2  <<< -- for this one, i have some doubt about the right valu
#define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_LOW  <<<-- i think it should be HIGH

Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
11
2016/08/22 - 20:22
sp_Permalink sp_Print

Thanks for your hints:

The bluetooth fgpio isn't defined in the stock kernel but it makes no difference when i set it.

I once again checked the values of card detect and wifi pin in the stock kernel and they are both correct as they are. You are right with the interrupt enable value. But it is not used anywhere in the code so it does not make a difference.

Do you have any other hints? I think the problem is probably trivial but to find it is the real struggle.

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
12
2016/08/22 - 20:50
sp_Permalink sp_Print

DerFetzer said

I once again checked the values of card detect and wifi pin in the stock kernel and they are both correct as they are. You are right with the interrupt enable value. But it is not used anywhere in the code so it does not make a difference.

Hi,

well it should be used here link  it is very important i think. you can see it, used inside this function  .wifi_int_b = { } ,

and that function will be called by     gpio_request(rk_platform_wifi_gpio.wifi_int_b.io, "combo-WIFIINT");

another thing, your github is new and it is not an easy to search in it, because it is not indexed yet by the github it self.

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
13
2016/08/22 - 21:03
sp_Permalink sp_Print

why in your board-haier-1043.c  you are using

static void __init machine_rk30_board_init(void)
{
    int ret;    
************
************
    rk29sdk_wifi_bt_gpio_control_init();  <<---- this will not call the function i have mentioned above

 use this --->>>  rk29sdk_wifi_combo_module_gpio_init();
}

Avatar
DerFetzer
Member
Forum Posts: 11
Member Since:
2016/08/21
sp_UserOfflineSmall Offline
14
2016/08/22 - 21:32
sp_Permalink sp_Print

The chip inside my tablet is no combo chip so the function using the interrupt is not used and rk29sdk_wifi_combo_module_gpio_init() is not available because it is deleted by the preprocessor. When looking at the disassembled/decompiled machine_rk30_board_init() I am very sure that rk29sdk_wifi_bt_gpio_control_init() is the right function to call.

 

mussonero1 said

another thing, your github is new and it is not an easy to search in it, because it is not indexed yet by the github it self.  

The repository is not that new. I forked it in November last year. What are the consequences of a repository not beeing indexed yet? Can cou trigger it yourself someway?

Avatar
mussonero1

Contributor

Firmware Guru
Forum Posts: 318
Member Since:
2014/08/02
sp_UserOfflineSmall Offline

Thanks Received: 59
15
2016/08/22 - 22:01
sp_Permalink sp_Print

Could you please post the disassembled/decompiled machine_rk30_board_init()

From the kallsym i only could see these 

c068954c;3228079436;2626892;28154C;t;rk29sdk_wifi_status;;;
c068955c;3228079452;2626908;28155C;t;rk29sdk_wifi_status_register;;;
c0689588;3228079496;2626952;281588;t;rk29sdk_wifi_reset;;;
c068b180;3228086656;2634112;283180;T;rk29sdk_wifi_mac_addr;;;
c068b30c;3228087052;2634508;28330C;T;rk29sdk_wifi_set_carddetect;;;
c068bd20;3228089632;2637088;283D20;T;rk29sdk_wifi_power;;;
c0d61570;3235255664;9803120;959570;r;__ksymtab_rk29sdk_wifi_mac_addr;;;
c0d61578;3235255672;9803128;959578;r;__ksymtab_rk29sdk_wifi_power;;;
c0d61580;3235255680;9803136;959580;r;__ksymtab_rk29sdk_wifi_set_carddetect;;;
c0d680ff;3235283199;9830655;9600FF;r;__kstrtab_rk29sdk_wifi_mac_addr;;;
c0d68115;3235283221;9830677;960115;r;__kstrtab_rk29sdk_wifi_set_carddetect;;;
c0d68131;3235283249;9830705;960131;r;__kstrtab_rk29sdk_wifi_power;;;

Regarding the github, i think, it is something related to the activity .

Forum Timezone: Europe/Paris

Most Users Ever Online: 749

Currently Online: bigreceiver, MezaCorleehone
198 Guest(s)

Currently Browsing this Page:
1 Guest(s)


Devices in use: Desktop (156), Phone (37), Tablet (7)

Top Posters:

Oma7144: 5664

globula_neagra: 2424

finless: 604

DarthJabba: 551

exelletor: 450

JochenKauz: 450

cracktech: 430

maikal: 394

Newest Members:

MezaCorleehone

bigreceiver

Warhammer1041

agentbuddy88

dtbinhtomay

manukaitek

Forum Stats:

Groups: 10

Forums: 185

Topics: 5884

Posts: 58439

 

Member Stats:

Guest Posters: 43

Members: 255368

Moderators: 5

Admins: 1

Administrators: admin

Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech


CrewRKTablets moderators: JochenKauz and Astralix