Merge "enable squashfs"
diff --git a/Makefile b/Makefile
index 2c287e1..aa2f10633 100755
--- a/Makefile
+++ b/Makefile
@@ -339,6 +339,7 @@
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
+ -Wno-error=unused-but-set-variable \
-Wno-format-security \
-fno-delete-null-pointer-checks
KBUILD_AFLAGS := -D__ASSEMBLY__
diff --git a/drivers/mtd/devices/ath_flash.c b/drivers/mtd/devices/ath_flash.c
index 7e07e67..982fc2a 100755
--- a/drivers/mtd/devices/ath_flash.c
+++ b/drivers/mtd/devices/ath_flash.c
@@ -156,22 +156,31 @@
static int
read_buff_under16m(struct mtd_info *mtd, loff_t from, size_t len,
- size_t *retlen, u_char *buf)
+ size_t *retlen, u_char *buf)
{
- uint32_t addr = from | 0x9f000000;
-
- if (!len)
- return (0);
- if (from + len > mtd->size)
+ size_t i;
+ if (len == 0) {
+ return 0;
+ }
+ if (from + len > mtd->size) {
return (-EINVAL);
+ }
ath_flash_spi_down();
- memcpy(buf, (uint8_t *)(addr), len);
- *retlen = len;
+ ath_spi_write_enable();
+ ath_spi_bit_banger(ATH_SPI_CMD_READ);
+ ath_spi_send_addr((uint32_t) from);
+ for (i = 0; i < len; ++i) {
+ ath_spi_delay_8();
+ buf[i] = (u_char) ath_reg_rd(ATH_SPI_RD_STATUS);
+ }
+ ath_spi_go();
+ ath_spi_done();
ath_flash_spi_up();
+ *retlen = len;
return 0;
}