summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/exports.c6
-rw-r--r--common/image.c11
-rw-r--r--include/_exports.h3
-rw-r--r--include/flash.h21
-rw-r--r--include/spi.h2
5 files changed, 43 insertions, 0 deletions
diff --git a/common/exports.c b/common/exports.c
index b4f1f7af15..568be21fc9 100644
--- a/common/exports.c
+++ b/common/exports.c
@@ -21,6 +21,12 @@ unsigned long get_version(void)
# define phy_find_by_mask dummy
# define mdio_phydev_for_ethname dummy
# define miiphy_set_current_dev dummy
+#ifdef CONFIG_FMC_SPI
+# define spi_dma dummy
+#endif
+#endif
+#ifndef CONFIG_AST_SPI_NOR
+# define memmove_dma dummy
#endif
void jumptable_init(void)
diff --git a/common/image.c b/common/image.c
index 0be09e5c63..20c4807bde 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1069,6 +1069,17 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
return 1;
}
}
+/// TODO ... Check Why ..................
+#if defined(CONFIG_ARCH_ASPEED)
+ /*
+ * We need to copy the ramdisk to SRAM to let Linux boot
+ */
+ if (rd_data) {
+ memmove ((void *)rd_load, (uchar *)rd_data, rd_len);
+ rd_data = rd_load;
+ }
+#endif /* CONFIG_ASPEED */
+
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,
IH_TYPE_MULTI)) {
diff --git a/include/_exports.h b/include/_exports.h
index 11beeb24f1..d4ad18c35e 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -55,6 +55,9 @@
EXPORT_FUNC(dummy, void, spi_free_slave, void)
#else
EXPORT_FUNC(spi_init, void, spi_init, void)
+#ifdef CONFIG_FMC_SPI
+ EXPORT_FUNC(spi_dma)
+#endif
EXPORT_FUNC(spi_setup_slave, struct spi_slave *, spi_setup_slave,
unsigned int, unsigned int, unsigned int, unsigned int)
EXPORT_FUNC(spi_free_slave, void, spi_free_slave, struct spi_slave *)
diff --git a/include/flash.h b/include/flash.h
index 2a5e13a13d..6041bcb22e 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -47,6 +47,23 @@ typedef struct {
#ifdef CONFIG_MTD
struct mtd_info *mtd;
#endif
+#ifdef CONFIG_AST_SPI_NOR
+ ulong reg_base;
+ ulong readcmd;
+ ulong dualport;
+ ulong dummybyte;
+ ulong tCK_Write;
+ ulong tCK_Erase;
+ ulong tCK_Read;
+ ulong CE;
+ ulong sysspi;
+ ulong iomode;
+ ulong address32;
+ ulong quadport;
+ ulong dummydata;
+ ulong buffersize;
+ ulong specificspi;
+#endif
} flash_info_t;
extern flash_info_t flash_info[]; /* info for FLASH chips */
@@ -98,6 +115,10 @@ extern int flash_write (char *, ulong, ulong);
extern flash_info_t *addr2info (ulong);
extern int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt);
+#ifdef CONFIG_AST_SPI_NOR
+extern void memmove_dma(void * dest,const void *src,size_t count);
+#endif
+
/* drivers/mtd/cfi_mtd.c */
#ifdef CONFIG_FLASH_CFI_MTD
extern int cfi_mtd_init(void);
diff --git a/include/spi.h b/include/spi.h
index ca96fa4b31..0becf81d56 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -194,6 +194,8 @@ void *spi_do_alloc_slave(int offset, int size, unsigned int bus,
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int mode);
+void spi_dma(struct spi_slave *slave, void *to, void *from, size_t len);
+
/**
* Free any memory associated with a SPI slave.
*
OpenPOWER on IntegriCloud