core/linux-olinuxino adapt for usage with U-Boot

This commit is contained in:
Kiril Zyapkov 2013-04-25 21:01:03 +03:00
parent 0d62afe0d9
commit 4d72196853
5 changed files with 87 additions and 45 deletions

View file

@ -0,0 +1,40 @@
From 5a70382dd43a27ae4bc8d8d6af5f7341828f23ad Mon Sep 17 00:00:00 2001
From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Date: Fri, 5 Apr 2013 01:18:38 -0300
Subject: [PATCH 1/2] mmc: mxs-mmc: Add support for non-removable cards
Some boards and card slots doesn't have card detect feature available.
In that case allow to mark the cards as non-removable, via devicetree.
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
drivers/mmc/host/mxs-mmc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe302..7d2cd74 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
struct mxs_mmc_host *host = mmc_priv(mmc);
struct mxs_ssp *ssp = &host->ssp;
+ if (mmc->caps & MMC_CAP_NONREMOVABLE)
+ return 1;
+
return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
BM_SSP_STATUS_CARD_DETECT);
}
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
if (flags & OF_GPIO_ACTIVE_LOW)
host->wp_inverted = 1;
+ if (of_find_property(np, "non-removable", NULL))
+ mmc->caps |= MMC_CAP_NONREMOVABLE;
+
mmc->f_min = 400000;
mmc->f_max = 288000000;
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
--
1.7.10.4

View file

@ -0,0 +1,28 @@
From ab30d1b8a94e2ba62f8844098ae0c2d9798a6d60 Mon Sep 17 00:00:00 2001
From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Date: Fri, 5 Apr 2013 01:16:53 -0300
Subject: [PATCH 2/2] ARM: dts: imx23-olinuxino: Set the sdcard as
non-removable
The imx23-olinuxino sdcard doesn't support card detect.
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
arch/arm/boot/dts/imx23-olinuxino.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index e7484e4..03f55c2 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -29,6 +29,7 @@
pinctrl-names = "default";
pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>;
bus-width = <4>;
+ non-removable;
status = "okay";
};
--
1.7.10.4

View file

@ -9,11 +9,11 @@ pkgname=('linux-olinuxino' 'linux-headers-olinuxino')
_kernelname=${pkgname#linux}
_basekernel=3.7
pkgver=${_basekernel}.2
pkgrel=2
pkgrel=3
arch=('arm')
url="http://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'uboot-mkimage' 'elftosb' 'imx-bootlets-olinuxino' 'imx-bootlets-olinuxino-ntsc')
makedepends=('xmlto' 'docbook-xsl' 'uboot-mkimage')
options=('!strip')
source=("http://www.kernel.org/pub/linux/kernel/v3.0/linux-${_basekernel}.tar.xz"
"ftp://ftp.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.bz2"
@ -21,13 +21,17 @@ source=("http://www.kernel.org/pub/linux/kernel/v3.0/linux-${_basekernel}.tar.xz
'change-default-console-loglevel.patch'
'0001-ARM-imx23-olinuxino-Add-spi-support.patch'
'0001-MXS-imx23-olinuxino-Add-i2c-support.patch'
'0001-mmc-mxs-mmc-Add-support-for-non-removable-cards.patch'
'0002-ARM-dts-imx23-olinuxino-Set-the-sdcard-as-non-remova.patch'
'0001-rtl8192cu.patch')
md5sums=('21223369d682bcf44bcdfe1521095983'
'b88977838a2a52ff4fb4e82b30726496'
'23a7b5a1f8030d8d2358ffd61facde41'
'2e55d4387dade59532393a3e882f543f'
'9d3c56a4b999c8bfbd4018089a62f662'
'13fc27b36015d5a4bd82ce3e6d9d016e'
'acc5de524247ec1aff5c9af6a486652f'
'8a034a737c554cc4ef99ca3854ad56d5'
'ef27d61a159fa9fcba6e7b93e9f630f2'
'3073241240a0536d53408bd94dd5644a')
build() {
@ -47,7 +51,9 @@ build() {
patch -Np1 -i "${srcdir}/0001-ARM-imx23-olinuxino-Add-spi-support.patch"
patch -Np1 -i "${srcdir}/0001-MXS-imx23-olinuxino-Add-i2c-support.patch"
patch -Np1 -i "${srcdir}/0001-rtl8192cu.patch"
patch -Np1 -i "${srcdir}/0001-mmc-mxs-mmc-Add-support-for-non-removable-cards.patch"
patch -Np1 -i "${srcdir}/0002-ARM-dts-imx23-olinuxino-Set-the-sdcard-as-non-remova.patch"
cat "${srcdir}/config" > ./.config
# set extraversion to pkgrel
@ -80,13 +86,13 @@ build() {
#yes "" | make config
# build!
make ${MAKEFLAGS} zImage modules imx23-olinuxino.dtb
make ${MAKEFLAGS} uImage modules imx23-olinuxino.dtb
}
package_linux-olinuxino() {
pkgdesc="The Linux Kernel and modules - i.MX233 OLinuXino"
groups=('base')
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7' 'uboot-olinuxino')
optdepends=('crda: to set the correct wireless channels of your country')
provides=('kernel26' 'linux=${pkgver}')
conflicts=('kernel26-olinuxino')
@ -102,9 +108,9 @@ package_linux-olinuxino() {
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH="${pkgdir}" modules_install
# Append olinuxino DT to zImage
cat arch/$KARCH/boot/zImage arch/arm/boot/imx23-olinuxino.dtb > "${pkgdir}/boot/zImage"
ln -sf "${pkgdir}/boot/zImage" .
# install uImage and DTB
cp arch/$KARCH/boot/uImage "${pkgdir}/boot/uImage"
cp arch/$KARCH/boot/imx23-olinuxino.dtb "${pkgdir}/boot/imx23-olinuxino.dtb"
# set correct depmod command for install
sed \
@ -112,15 +118,6 @@ package_linux-olinuxino() {
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i "${startdir}/${pkgname}.install"
# Generate an imx233 boot image
msg "Generating PAL sdcard image ..."
ln -sf /opt/imx-bootlets-olinuxino
elftosb -z -c ./imx-bootlets-olinuxino/linux.bd -o ${pkgdir}/boot/oli-${_kernver}-pal.sb
msg "Generating NTSC sdcard image ..."
ln -sf /opt/imx-bootlets-olinuxino-ntsc
elftosb -z -c ./imx-bootlets-olinuxino-ntsc/linux.bd -o ${pkgdir}/boot/oli-${_kernver}-ntsc.sb
# remove build and source links
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
# remove the firmware

View file

@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.7.2 Kernel Configuration
# Linux/arm 3.7.2-3 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
@ -364,9 +364,8 @@ CONFIG_ATAGS=y
# CONFIG_DEPRECATED_PARAM_STRUCT is not set
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
# CONFIG_ARM_APPENDED_DTB is not set
# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
CONFIG_CMDLINE=""
# CONFIG_XIP_KERNEL is not set

View file

@ -1,29 +1,8 @@
KERNEL_NAME=-olinuxino
KERNEL_VERSION=3.7.2-2-ARCH
flush_kernel() {
echo "Do you want the new kernel flashed onto mmcblk0p1? [y|N] "
# something traps the last line of output, so users can't see the
# question ...
read -r shouldwe
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo ""
echo "Specify NTSC or PAL display output [N|P]: "
read -r disp
if [[ $disp =~ ^([nN][tT][sS][cC]|[nN])$ ]]; then
echo "Writing the NTSC kernel image on /dev/mmcblk0p1 ..."
dd if=/boot/oli-${KERNEL_VERSION}-ntsc.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
fi
if [[ $disp =~ ^([pP][aA][lL]|[pP])$ ]]; then
echo "Writing the PAL kernel image on /dev/mmcblk0p1 ..."
dd if=/boot/oli-${KERNEL_VERSION}-pal.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
fi
fi
}
KERNEL_VERSION=3.7.2-3-ARCH
## arg 1: the new package version
post_install() {
flush_kernel
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}
@ -33,7 +12,6 @@ post_install() {
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
flush_kernel
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}