Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #
  2. # Copyright (C) 2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. include $(INCLUDE_DIR)/kernel.mk
  8. PKG_NAME:=mmc-over-gpio
  9. PKG_RELEASE:=4
  10. include $(INCLUDE_DIR)/package.mk
  11. define KernelPackage/mmc-over-gpio
  12. SUBMENU:=Other modules
  13. DEPENDS:=@GPIO_SUPPORT +kmod-mmc-spi +kmod-spi-gpio-old +kmod-fs-configfs @!LINUX_4_4
  14. KCONFIG:=CONFIG_GPIOMMC
  15. TITLE:=MMC/SD card over GPIO support
  16. FILES:=$(LINUX_DIR)/drivers/mmc/host/gpiommc.ko
  17. AUTOLOAD:=$(call AutoProbe,gpiommc)
  18. MENU:=1
  19. endef
  20. define Package/kmod-mmc-over-gpio/config
  21. menu "Configuration"
  22. depends on PACKAGE_kmod-mmc-over-gpio
  23. config KMOD_MMC_OVER_GPIO_DI_PIN
  24. int "GPIO DI (Data-In) pin"
  25. default 1
  26. config KMOD_MMC_OVER_GPIO_DO_PIN
  27. int "GPIO DO (Data-Out) pin"
  28. default 3
  29. config KMOD_MMC_OVER_GPIO_CLK_PIN
  30. int "GPIO CLK (Clock) pin"
  31. default 4
  32. config KMOD_MMC_OVER_GPIO_CS_PIN
  33. int "GPIO CS (Chip-Select) pin"
  34. default 7
  35. endmenu
  36. endef
  37. define KernelPackage/mmc-over-gpio/description
  38. Support for driving an MMC/SD card over GPIO pins via SPI.
  39. endef
  40. define KernelPackage/mmc-over-gpio/conffiles
  41. /etc/config/mmc_over_gpio
  42. endef
  43. define Build/Prepare
  44. mkdir -p $(PKG_BUILD_DIR)
  45. endef
  46. define Build/Compile
  47. endef
  48. define KernelPackage/mmc-over-gpio/install
  49. $(INSTALL_DIR) $(1)/etc/config
  50. $(INSTALL_DATA) ./files/mmc_over_gpio.config $(1)/etc/config/mmc_over_gpio
  51. $(INSTALL_DIR) $(1)/etc/init.d
  52. $(INSTALL_BIN) ./files/mmc_over_gpio.init $(1)/etc/init.d/mmc_over_gpio
  53. $(SED) 's,@GPIO_DI_PIN@,$(CONFIG_KMOD_MMC_OVER_GPIO_DI_PIN),g' \
  54. -e 's,@GPIO_DO_PIN@,$(CONFIG_KMOD_MMC_OVER_GPIO_DO_PIN),g' \
  55. -e 's,@GPIO_CLK_PIN@,$(CONFIG_KMOD_MMC_OVER_GPIO_CLK_PIN),g' \
  56. -e 's,@GPIO_CS_PIN@,$(CONFIG_KMOD_MMC_OVER_GPIO_CS_PIN),g' \
  57. $(1)/etc/config/mmc_over_gpio
  58. endef
  59. $(eval $(call KernelPackage,mmc-over-gpio))