Skip to contentSkip to conversation

mxs-bootlets: add support for custom patches

PATCH New Gustavo Zacarias 3 participants 6 messages May 18, 2013 – May 27, 2013 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mxs-bootlets: add support for custom patches

---
 boot/mxs-bootlets/Config.in       | 9 +++++++++
 boot/mxs-bootlets/mxs-bootlets.mk | 8 ++++++++
 2 files changed, 17 insertions(+)
boot/mxs-bootlets/Config.in +9 -0
index 2222ff6..9dc2d37 100644
@@ -37,6 +37,15 @@ config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION
 
 endif
 
+config BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR
+	string "custom patch dir"
+	help
+	  If your board requires custom patches, add the path to the
+	  directory containing the patches here. The patches must be
+	  named mxs-bootlets-<something>.patch.
+
+	  Most users may leave this empty
+
 choice
 	prompt "Bootstream"
 	help
boot/mxs-bootlets/mxs-bootlets.mk +8 -0
index f93ff81..6b18fcc 100644
@@ -4,6 +4,14 @@
 #
 #############################################################
 
+ifneq ($(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR)),)
+define MXS_BOOTLETS_APPLY_CUSTOM_PATCHES
+	support/scripts/apply-patches.sh $(@D) $(BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR) \
+		mxs-bootlets-\*.patch
+endef
+MXS_BOOTLETS_POST_PATCH_HOOKS += MXS_BOOTLETS_APPLY_CUSTOM_PATCHES
+endif
+
 ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL),y)
 	MXS_BOOTLETS_TARBALL = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL))
 	MXS_BOOTLETS_SITE = $(patsubst %/,%,$(dir $(MXS_BOOTLETS_TARBALL)))
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 2/2 configs: add sample for olimex mx233 olinuxino

---
 ...x-01-mmc-mxs-mmc-add-cd-inverted-property.patch |  47 ++++++
 ...02-mmc-mxs-mmc-add-non-removable-property.patch |  53 ++++++
 ...nux-03-mmc-mxs-mmc-add-broken-cd-property.patch |  50 ++++++
 ...-imx23-olinuxino-mark-sdcard-cd-as-broken.patch |  28 +++
 board/olimex/imx233_olinuxino/linux-3.9.config     | 188 +++++++++++++++++++++
 .../imx233_olinuxino/mxs-bootlets-olinuxino.patch  | 122 +++++++++++++
 board/olimex/imx233_olinuxino/readme.txt           |  54 ++++++
 configs/olimex_imx233_olinuxino_defconfig          |  30 ++++
 8 files changed, 572 insertions(+)
 create mode 100644 board/olimex/imx233_olinuxino/linux-01-mmc-mxs-mmc-add-cd-inverted-property.patch
 create mode 100644 board/olimex/imx233_olinuxino/linux-02-mmc-mxs-mmc-add-non-removable-property.patch
 create mode 100644 board/olimex/imx233_olinuxino/linux-03-mmc-mxs-mmc-add-broken-cd-property.patch
 create mode 100644 board/olimex/imx233_olinuxino/linux-04-ARM-dts-imx23-olinuxino-mark-sdcard-cd-as-broken.patch
 create mode 100644 board/olimex/imx233_olinuxino/linux-3.9.config
 create mode 100644 board/olimex/imx233_olinuxino/mxs-bootlets-olinuxino.patch
 create mode 100644 board/olimex/imx233_olinuxino/readme.txt
 create mode 100644 configs/olimex_imx233_olinuxino_defconfig
board/olimex/imx233_olinuxino/linux-01-mmc-mxs-mmc-add-cd-inverted-property.patch new file +47 -0
new file mode 100644
index 0000000..6e58c8c
@@ -0,0 +1,47 @@
+From 4c0c9be05004d1eb674b7586216b3d93cc04531c Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <[email protected]>
+Date: Wed, 10 Apr 2013 11:13:43 +0200
+Subject: [PATCH 1/3] mmc: mxs-mmc: add cd-inverted property
+
+The card-detect GPIO is inverted on some boards. Handle such case.
+
+Acked-by: Shawn Guo <[email protected]>
+Signed-off-by: Marc Kleine-Budde <[email protected]>
+Signed-off-by: Chris Ball <[email protected]>
+---
+ drivers/mmc/host/mxs-mmc.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
+index 4efe302..0cdf1f6 100644
+--- a/drivers/mmc/host/mxs-mmc.c
++++ b/drivers/mmc/host/mxs-mmc.c
+@@ -72,6 +72,7 @@ struct mxs_mmc_host {
+ 	int				sdio_irq_en;
+ 	int				wp_gpio;
+ 	bool				wp_inverted;
++	bool				cd_inverted;
+ };
+
+ static int mxs_mmc_get_ro(struct mmc_host *mmc)
+@@ -96,7 +97,7 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
+ 	struct mxs_ssp *ssp = &host->ssp;
+
+ 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
+-		 BM_SSP_STATUS_CARD_DETECT);
++		 BM_SSP_STATUS_CARD_DETECT)) ^ host->cd_inverted;
+ }
+
+ static void mxs_mmc_reset(struct mxs_mmc_host *host)
+@@ -691,6 +692,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
+ 	if (flags & OF_GPIO_ACTIVE_LOW)
+ 		host->wp_inverted = 1;
+
++	host->cd_inverted = of_property_read_bool(np, "cd-inverted");
++
+ 	mmc->f_min = 400000;
+ 	mmc->f_max = 288000000;
+ 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+--
+1.8.1.5
+
board/olimex/imx233_olinuxino/linux-02-mmc-mxs-mmc-add-non-removable-property.patch new file +53 -0

53 lines not on this page · raw message

board/olimex/imx233_olinuxino/linux-03-mmc-mxs-mmc-add-broken-cd-property.patch new file +50 -0

50 lines not on this page · raw message

board/olimex/imx233_olinuxino/linux-04-ARM-dts-imx23-olinuxino-mark-sdcard-cd-as-broken.patch new file +28 -0
new file mode 100644
index 0000000..7ce42b9
@@ -0,0 +1,28 @@
+From 1897fda94190498573f9d1b72bc6b7b58c720957 Mon Sep 17 00:00:00 2001
+From: Alexandre Pereira da Silva <[email protected]>
+Date: Sat, 6 Apr 2013 10:42:10 -0300
+Subject: [PATCH 1/1] ARM: dts: imx23-olinuxino: mark sdcard cd as broken
+
+The imx23-olinuxino sdcard doesn't have card detect.
+
+Signed-off-by: Alexandre Pereira da Silva <[email protected]>
+Signed-off-by: Shawn Guo <[email protected]>
+---
+ 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..d107c4a 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>;
++				broken-cd;
+ 				status = "okay";
+ 			};
+
+--
+1.8.1.5
+
board/olimex/imx233_olinuxino/linux-3.9.config new file +188 -0

188 lines not on this page · raw message

board/olimex/imx233_olinuxino/mxs-bootlets-olinuxino.patch new file +122 -0

122 lines not on this page · raw message

board/olimex/imx233_olinuxino/readme.txt new file +54 -0

54 lines not on this page · raw message

configs/olimex_imx233_olinuxino_defconfig new file +30 -0
new file mode 100644
index 0000000..e5d2d26
@@ -0,0 +1,30 @@
+# Architecture
+BR2_arm=y
+BR2_arm926t=y
+
+# system
+BR2_TARGET_GENERIC_GETTY=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+
+# filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Lock to 3.9 headers to avoid breaking with newer kernels
+BR2_KERNEL_HEADERS_3_9=y
+
+# Bootloader
+BR2_TARGET_MXS_BOOTLETS=y
+BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR="board/olimex/imx233_olinuxino"
+BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD=y
+BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME="imx23_olinuxino_dev"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.9.2"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/olimex/imx233_olinuxino/linux-3.9.config"
+BR2_LINUX_KERNEL_PATCH="board/olimex/imx233_olinuxino"
+BR2_LINUX_KERNEL_APPENDED_ZIMAGE=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx23-olinuxino"
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 1/2 mxs-bootlets: add support for custom patches

In reply to Gustavo Zacarias
Quoted 13 lines · Gustavo Zacarias
---
  boot/mxs-bootlets/Config.in       | 9 +++++++++
  boot/mxs-bootlets/mxs-bootlets.mk | 8 ++++++++
  2 files changed, 17 insertions(+)
boot/mxs-bootlets/Config.in +0 -0
index 2222ff6..9dc2d37 100644
@@ -37,6 +37,15 @@ config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION
 
  endif

boot/mxs-bootlets/Config.in config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION · line 48

Quoted 10 lines
boot/mxs-bootlets/Config.in +9 -0
 
+config BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR
+	string "custom patch dir"
+	help
+	  If your board requires custom patches, add the path to the
+	  directory containing the patches here. The patches must be
+	  named mxs-bootlets-<something>.patch.
+
+	  Most users may leave this empty
+

Now that we have BR2_GLOBAL_PATCH_DIR, I would prefer to avoid adding
config options like this... Admittedly, for bootloaders it is more likely that custom patches are needed than for any other package. But even so, the global patch dir is sufficient, it is quite useable, and it reduces complexity in the buildroot core.

Regards,
Arnout

Quoted 23 lines
boot/mxs-bootlets/Config.in +0 -0
  choice
  	prompt "Bootstream"
  	help
boot/mxs-bootlets/mxs-bootlets.mk +8 -0
index f93ff81..6b18fcc 100644
@@ -4,6 +4,14 @@
  #
  #############################################################
 
+ifneq ($(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR)),)
+define MXS_BOOTLETS_APPLY_CUSTOM_PATCHES
+	support/scripts/apply-patches.sh $(@D) $(BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR) \
+		mxs-bootlets-\*.patch
+endef
+MXS_BOOTLETS_POST_PATCH_HOOKS += MXS_BOOTLETS_APPLY_CUSTOM_PATCHES
+endif
+
  ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL),y)
  	MXS_BOOTLETS_TARBALL = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL))
  	MXS_BOOTLETS_SITE = $(patsubst %/,%,$(dir $(MXS_BOOTLETS_TARBALL)))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/2 mxs-bootlets: add support for custom patches

Dear Arnout Vandecappelle,

Quoted 7 lines · Arnout Vandecappelle
Quoted 7 lines
boot/mxs-bootlets/Config.in +7 -0
+config BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR
+	string "custom patch dir"
+	help
+	  If your board requires custom patches, add the path to the
+	  directory containing the patches here. The patches must be
+	  named mxs-bootlets-<something>.patch.
+
Quoted 8 lines

boot/mxs-bootlets/Config.in config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION · line 48

Quoted 2 lines
boot/mxs-bootlets/Config.in +2 -0
+	  Most users may leave this empty
+

Now that we have BR2_GLOBAL_PATCH_DIR, I would prefer to avoid adding
config options like this... Admittedly, for bootloaders it is more likely that custom patches are needed than for any other package. But even so, the global patch dir is sufficient, it is quite useable, and it reduces complexity in the buildroot core.

This means that a defconfig would have to define a value for BR2_GLOBAL_PATCH_DIR, in this particular case. Is this something we really want?

Also, what about the existing *_CUSTOM_PATCH_DIR config options we have for Linux, U-Boot, Barebox and a bunch of other boot/kernel packages?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/2 mxs-bootlets: add support for custom patches

Quoted 20 lines · Thomas Petazzoni

Dear Arnout Vandecappelle,

Quoted 7 lines · Arnout Vandecappelle
Quoted 7 lines
boot/mxs-bootlets/Config.in +7 -0
+config BR2_TARGET_MXS_BOOTLETS_CUSTOM_PATCH_DIR
+	string "custom patch dir"
+	help
+	  If your board requires custom patches, add the path to the
+	  directory containing the patches here. The patches must be
+	  named mxs-bootlets-<something>.patch.
+
Quoted 8 lines

boot/mxs-bootlets/Config.in config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION · line 48

Quoted 2 lines
boot/mxs-bootlets/Config.in +2 -0
+	  Most users may leave this empty
+

Now that we have BR2_GLOBAL_PATCH_DIR, I would prefer to avoid adding
config options like this... Admittedly, for bootloaders it is more likely that custom patches are needed than for any other package. But even so, the global patch dir is sufficient, it is quite useable, and it reduces complexity in the buildroot core.

Quoted 3 lines

This means that a defconfig would have to define a value for BR2_GLOBAL_PATCH_DIR, in this particular case. Is this something we really want?

I would say yes, I'd prefer that defconfigs define BR2_GLOBAL_PATCH_DIR
to point to board/xxx/yyy/patches. Then they come much closer to how you would use buildroot in practice.

Quoted 2 lines

Also, what about the existing *_CUSTOM_PATCH_DIR config options we have for Linux, U-Boot, Barebox and a bunch of other boot/kernel packages?

Here also I'm in favour of deprecating them.

But probably it's better to start using the global patch dir now, and
only start deprecating the old ways next year.

Regards,
Arnout

Quoted 3 lines

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH 1/2 mxs-bootlets: add support for custom patches

Quoted 11 lines · Arnout Vandecappelle
Quoted 2 lines

Also, what about the existing *_CUSTOM_PATCH_DIR config options we have for Linux, U-Boot, Barebox and a bunch of other boot/kernel packages?

Here also I'm in favour of deprecating them.

But probably it's better to start using the global patch dir now, and
only start deprecating the old ways next year.

Regards,
Arnout

Ok, let's go for BR2_GLOBAL_PATCH_DIR, sent a V2 respinned. Regards.