From f4446e8f9e1be2d0b78ef493740b8871e20c8e57 Mon Sep 17 00:00:00 2001 From: luka Date: Tue, 22 Jan 2013 12:55:01 +0000 Subject: uboot-lantiq: upgrade to 2013.01 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35292 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches/0017-sf-add-init-function.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/boot/uboot-lantiq/patches/0017-sf-add-init-function.patch (limited to 'package/boot/uboot-lantiq/patches/0017-sf-add-init-function.patch') diff --git a/package/boot/uboot-lantiq/patches/0017-sf-add-init-function.patch b/package/boot/uboot-lantiq/patches/0017-sf-add-init-function.patch new file mode 100644 index 0000000000..2d290513b1 --- /dev/null +++ b/package/boot/uboot-lantiq/patches/0017-sf-add-init-function.patch @@ -0,0 +1,57 @@ +From aa9d5d64ca6441cb24e22dc3c1f707da62da2887 Mon Sep 17 00:00:00 2001 +From: Daniel Schwierzeck +Date: Tue, 6 Nov 2012 19:35:17 +0100 +Subject: sf: add init function + +Signed-off-by: Daniel Schwierzeck + +--- a/drivers/mtd/spi/spi_flash.c ++++ b/drivers/mtd/spi/spi_flash.c +@@ -482,3 +482,36 @@ void spi_flash_free(struct spi_flash *fl + spi_flash_free_spl(flash); + free(flash); + } ++ ++#ifdef CONFIG_SPI_FLASH_MTD ++static int spi_flash_mtd_register(void) ++{ ++ struct spi_flash *flash; ++ int err; ++ ++ flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, ++ CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); ++ if (!flash) ++ return -1; ++ ++ err = spi_flash_mtd_init(flash); ++ if (err) ++ spi_flash_free(flash); ++ ++ return err; ++} ++#else ++static int spi_flash_mtd_register(void) ++{ ++ return 0; ++} ++#endif ++ ++int spi_flash_init(void) ++{ ++ int err; ++ ++ err = spi_flash_mtd_register(); ++ ++ return err; ++} +--- a/include/spi_flash.h ++++ b/include/spi_flash.h +@@ -51,6 +51,8 @@ struct spi_flash { + #endif + }; + ++int spi_flash_init(void); ++ + struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int spi_mode); + void spi_flash_free(struct spi_flash *flash); -- cgit v1.2.3