Hi All,
This is an absolutely silly question, but I need some help to continue.
I started working with one i.MX28 EVK evaluation board from freescale, installed LTIB (L2.6.35_10.12.01_SDK_source_bundle; Ubuntu 10.10 workstation host) and managed to create my first kernel images (uBoot + TFTP + NFS).
My question is, How do I do for applying patches from the following archives downloaded from freescale's site?
- L2.6.35_10.12_EMI_FREQ_PATCH_UP.tar.gz
- L2.6.35_10.12_SDK_5V_SUPPLY_PATCH.tar.gz
- mx28_ssppolarity_rompatch_up.zip
- MX28-FEC-PROBLEM-PATCH.tar.gz
- patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz
For example, patch file named "0001-MX28-imx-bootlets-adds-the-most-robust-support-for-VDD5V-only-configuration.patch" references a source file named "power_prep/power_prep.c" which I could not find in the source tree (neither under LTIB instalation root folder nor under /opt/freescale).
Thanks a lot in advance, Victor
Hi Victor, I am facing problem of booting from SD CARD. I am trying to apply patch "mx28_ssppolarity_rompatch_up.zip". If you don't mind then can you please provide the steps to apply this patch. Thanks, RAM
Just in case it could be helpful for newcomers, this was the answer I received from Freescale (technical support) to a service request relating this topic. And thanks a lot to Yuji Sasaki for his comments and Abisai for his response from freescale.
----
The patches under rpm/BUILD/linux/patches are already applied when the LTIB was installed the fist time.
The new patches (from http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCIMX28EVKJ&fpsp=1&tab=Design_Tools_T... -- Updates and Patches)
L2.6.35_10.12_EMI_FREQ_PATCH_UP.tar.gz
L2.6.35_10.12_SDK_5V_SUPPLY_PATCH.tar.gz
MX28-FEC-PROBLEM-PATCH.tar.g
You should copy the file patches in the path directory used by the patch, for example:
"diff --git a/arch/arm/mach-mx28/clock.c b/arch/arm/mach-mx28/clock.c"
The file should be copied to "<LTIB>/rpm/BUIL/linux"
To apply the patch you need to use the command
patch -p1 < 000xXX.patch for each file in order.
In the case of L2.6.35_10.12_SDK_5V_SUPPLY_PATCH.tar.gz, you need to prepare the imx-bootlets source code.
You need to enter the next command
./ltib -m prep -p imx-bootlets
patch -p1 < 000xXX.patch for each file in order.
./ltib -m scbuild -p imx-bootlets
./ltib -m scdeploy -p imx-bootlets
For the rest of the patches (about the drivers) once all patches were applied, enter the command
./ltib -c
Select "Configure the kernel"
Exit -- Yes
Exit -- Yes
----
Hi all!!
I am trying to install the patch L2.6.35_10.12_SDK_5V_SUPPLY_PATCH.tar.gz but the system returns this errors:
mfabiani@mfabiani-desktop:~/imx28/ltib/rpm/BUILD/imx-bootlets-src-10.12.01/power_prep$ patch -p1 < 0001-MX28-imx-bootlets-adds-the-most-robust-support-for-VDD5V-only-configuration.patch
patching file power_prep/power_prep.c
Hunk #1 FAILED at 86.
Hunk #2 FAILED at 125.
Hunk #3 FAILED at 138.
Hunk #4 FAILED at 161.
Hunk #5 FAILED at 281.
Hunk #6 FAILED at 317.
Hunk #7 FAILED at 330.
Hunk #8 FAILED at 339.
Hunk #9 FAILED at 404.
Hunk #10 FAILED at 646.
10 out of 10 hunks FAILED -- saving rejects to file power_prep/power_prep.c.rej
Do you have any suggestions?
I copied the patch file in the directori "ltib/rpm/BUILD/imx-bootlets-src-10.12.01/power_prep" and launched the command
patch -p1 < 000xXX.patch.
Thanks to all!
Try running the same command under ~/imx28/ltib/rpm/BUILD/imx-bootlets-src-10.12.01/
Leo
Thanks Leonardo.
Now I have applied the first two patch copying the file in the path directory used by the patch, for example
"diff --git a/power_prep/power_prep.c b/power_prep/power_prep.c"
In the third and fourth patch there are several
"diff --git a/... b/..."
"diff --git a/... b/..."
what should I do in this case?
where do I copy the patch files?
Best regards,
Matteo.
Hi Matteo,
Each 'diff --git a/.. b/..' is a hunk, and the patch command patches every hunk on a particular patch file. The patch parameter -pN indicates how many tree levels to ignore on this diff line. So, placing all your patches into the imx-bootlets-src-10.12.01 folder and patching with -p1 (ignoring the a and b folders) should work.
I don't know the reason, but ltib seems does not automatically detect changes made in rpm/BUILD source code. I used ./ltib -m and check "[] Always rebuild the kernel" option to rebuild the Kernel.
I confirmed "CONFIG_WORKAROUND_ARCUSB_REG_RW" is defined in .config file after the patch. Maybe I missed my previous patching.
Hi Yuji,
Thanks for your response. Following your tips I patched the kernel with patches included in archive "patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz" but compiling with ./ltib did not show any errors to me.
One more interest thing is running ./ltib after patching presumably did not detected changes in files and simply said "Build Succeded".
Should it detect changes made by patch tool and recompile automatically? Or, did I forget doing some other required operation?
Once again, thanks a lot for your help
Victor
p.d. I'm writing a bash script for automating this a little bit. The script is incomplete and still plenty of bugs, but it's my first script or at least the first one with more than one text line. It's attached to this reply just in case it could be useful for some one.
Yuji Sasaki said:
In your project directory, run ./ltib -m config then check "Leave the source after building".
Run ltib.
cd rpm/BUILD/linux-2.6.35.3
You will find Kernel source there.
To apply patch, I used "git apply <patch file name>" (with your current directory is rpm/BULID/linux-2.6.35.3) specifying individual patch files. This is annoying, but I wanted make sure which patch was failed to apply.
I experienced Kernel compile error after I applied patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz. Patch number 590 "mx28-usb-bugs-found.patch" will replace __raw_write_l() API with fsl_safe_writel(), but this replacement is conditioned with #if CONFIG_WORKAROUND_ARCUSB_REG_RW but this macro is not defined anywhere. I had to manually add in arch/arm/mach-mx28/Kconfig as;
config WORKAROUND_ARCUSB_REG_RW
bool "USB register access workaround"
default y
In your project directory, run ./ltib -m config then check "Leave the source after building".
Run ltib.
cd rpm/BUILD/linux-2.6.35.3
You will find Kernel source there.
To apply patch, I used "git apply <patch file name>" (with your current directory is rpm/BULID/linux-2.6.35.3) specifying individual patch files. This is annoying, but I wanted make sure which patch was failed to apply.
I experienced Kernel compile error after I applied patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz. Patch number 590 "mx28-usb-bugs-found.patch" will replace __raw_write_l() API with fsl_safe_writel(), but this replacement is conditioned with #if CONFIG_WORKAROUND_ARCUSB_REG_RW but this macro is not defined anywhere. I had to manually add in arch/arm/mach-mx28/Kconfig as;
config WORKAROUND_ARCUSB_REG_RW
bool "USB register access workaround"
default y