How to improve boot time (postpone e. g. ethernet driver startup)?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to improve boot time (postpone e. g. ethernet driver startup)?

Jump to solution
2,265 Views
bitlauncher
Contributor II

I am quite new to Linux and tool chain.

I want to improve boot time to some few seconds (from about 45 seconds) for an embedded device using the i.Mx53.

Ethernet connection is not immediately required. Therefore the initialization of the driver could be postponed, e. g.

triggered by a startup applications entry in Ubuntu 10.04 LTS.

I have LTIB installed in an VMPlayer image from Freescale, that is running.

I found out, how to log time stamps with the dmesg messages - using several seconds for ethernet:

...

[3.188496] EXT3-fs (mmcblk1p1): mounted filesystem with writeback data mode
[3.195784] VFS: Mounted root (ext3 filesystem) on device 179:9.
[3.201866] Freeing init memory: 172K

[   14.315784] eth18: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)

[   16.224619] sgtl5000_write: write reg error : Reg 0x10 = 0x6262

[   16.308874] PHY: 0:00 - Link is Up - 100/Full

[   17.999442] mxc_ipu mxc_ipu: Channel already disabled 9

...

How can I postpone the ethernet driver initialization?

Another time consuming parts are:

...

[   21.453034] mxc_ipu mxc_ipu: Channel already uninitialized 9

[   21.468712] DMFC high resolution has set, will not change

[   29.935493] sgtl5000_write: write reg error : Reg 0x06 = 0x0080

[   31.013038] ehci_fsl_bus_resume, DR

[   38.719007] sgtl5000_hw_read: read reg error : Reg 0x0e

[   38.729912] sgtl5000_write: write reg error : Reg 0x0e = 0x000c

[   38.767677] sgtl5000_write: write reg error : Reg 0x02 = 0x0020

[   38.811864] sgtl5000_write: write reg error : Reg 0x06 = 0x0130

[   44.079862] EXT3-fs: barriers not enabled

[   44.093281] EXT3-fs (mmcblk0p1): warning: maximal mount count reached, running e2fsck is recommended

...

With google I found out that sgtl5000 is the audio chip. We do not need audio (immediately).

What are the other messages?

How can I reduce their times - or disable/postpone the actions?

The only thing we need quite soon is the USB connections to HID device(s) and display, reading from a further ext3 partition on SD card.


Thank for help.


Labels (2)
1 Solution
1,174 Views
bitlauncher
Contributor II

Hello Kirill

Thank you for your information and sorry for the delay.

I would like to try it, but on the other side Linux should not be our key knowledge.

We will use external resources to improve boot speed, this has been decided by management.

We use an iMX51 800 MHz – C# is fast enough for our applications.

Kindly regards

Markus Weber

View solution in original post

0 Kudos
6 Replies
1,174 Views
BrilliantovKiri
Senior Contributor I

1. set minimal timeout in U-Boot

2. disable all unused deviced in Linux

3. disable time output in Linux

4. turn off Linux output via Linux boot parameters quiet Linux Kernel Documentation :: kernel-parameters.txt

0 Kudos
1,174 Views
bitlauncher
Contributor II

Hi Kirill

1. I will reduce the U boot timeout for production purposes, the U boot timeout is not part of the dmesg logs

2. I disabled some devices to test it (even networking, what I do not know how to enable it later) - it improved some seconds, thank you

3. enabling time output to dmesg log did not increase time in my opinion remarkably (less than any second), therefore left untouched

4. about 30 s time is waited (no line is printed in that time in dmesg), therefore it has no influence

After removing some unused devices boot time improved slightly (too less) about some seconds.

I got still about 30 s, where it waits simply according to dmesg logs, or what does it do? I want to remove first these spoiled 30 s. - here the waiting parts in dmesg:

...

[6.416371] Freeing init memory: 156K

[   20.035780] mxc_ipu mxc_ipu: Channel already disabled 9 (--> here 13.6 seconds waiting...)

...

[   22.528875] DMFC high resolution has set, will not change

[   30.626114] ehci_fsl_bus_resume, DR

[   38.260971] EXT3-fs: barriers not enabled (--> totally 15.6 seconds waiting...)

...


If these waiting time is removed, the boot time is in an acceptable area.

What can I do to remove these bit waiting parts?

0 Kudos
1,174 Views
BrilliantovKiri
Senior Contributor I

Hello, Markus!

You can build devices drivers as modules and load it via insmod, it reduce Linux size and, as result, boot time. If you not use filesystem journal you can disable it or change filesystem. And you can embed filesystem in Linux if it not big.

«There’s more than one way to do it» (Perl).

0 Kudos
1,174 Views
bitlauncher
Contributor II

Hello Kirill

Thank you for your help.

Unfortunately I am no linux crack, and our main goal is to write a program in C# for Mono on the ARM processor from you.

Our company’s interest is not huge to let me become a linux expert.

So I do not understand how I can build device drivers as modules, but loading with insmod I probably could figure out reading google results using a lot of time.

I have to ask you, to provide more informations, why these gaps of several seconds in the dmesg log occur and to which entry in the configuration they belong, that I could switch it off. And how I can build modules – if they wouldn’t exist after a successful build, and where they are.

Thank you very much for any help in this direction.

Kindly regards

Markus Weber

0 Kudos
1,174 Views
BrilliantovKiri
Senior Contributor I

Hello, Markus!

C# on ARM? You have very power CPU :smileywink:

Ok, build driver as module very simple, for this you can make next steps:
1. change directory on Linux source

2. run "make menuconfig"

3. select drivers and set "M" in it status

4. exit from programm and save configuration

5. build Linux via "make uImage"

6. build drivers via "make modules"

Of cource you should be set path to tollchain and arh for each run make, .e.g. make ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- modules, or write this parameters in Makefile.

After this you will have drivers as external modules in files, .e.g. drivers/usb/gadget/g_ether.ko and you can load it after starting system via insmod or modprobe.

You can read about this in README or Documentation/kbuild/kconfig.txt in Linux sources.

0 Kudos
1,175 Views
bitlauncher
Contributor II

Hello Kirill

Thank you for your information and sorry for the delay.

I would like to try it, but on the other side Linux should not be our key knowledge.

We will use external resources to improve boot speed, this has been decided by management.

We use an iMX51 800 MHz – C# is fast enough for our applications.

Kindly regards

Markus Weber

0 Kudos