diff options
author | Yuji Mano <yuji.mano@am.sony.com> | 2009-02-11 11:34:50 -0800 |
---|---|---|
committer | Yuji Mano <yuji.mano@am.sony.com> | 2009-02-11 11:34:50 -0800 |
commit | 30acd06940179b5c11edfb2cbb702fb939b8c18d (patch) | |
tree | 4008115a5c5d76cfbec09bcf41d4d81227ddc580 | |
parent | f5aa4ee3142b26661403d36fb6da6a5b1f26683c (diff) | |
download | mars-src-30acd06940179b5c11edfb2cbb702fb939b8c18d.tar.gz |
base: Remove dma api
This removes the no longer used dma implementation and API from the base MPU
library.
This also removes the base MPU library dependency from the kernel.
Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
Acked-by: Kazunori Asayama <asayama@sm.sony.co.jp>
-rw-r--r-- | base/include/mpu/mars/dma.h | 158 | ||||
-rw-r--r-- | base/src/mpu/kernel/Makefile.am | 5 | ||||
-rw-r--r-- | base/src/mpu/lib/Makefile.am | 2 | ||||
-rw-r--r-- | base/src/mpu/lib/dma.c | 98 |
4 files changed, 1 insertions, 262 deletions
diff --git a/base/include/mpu/mars/dma.h b/base/include/mpu/mars/dma.h deleted file mode 100644 index e57420a..0000000 --- a/base/include/mpu/mars/dma.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2008 Sony Corporation of America - * - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this Library and associated documentation files (the - * "Library"), to deal in the Library without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Library, and to - * permit persons to whom the Library is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Library. - * - * If you modify the Library, you may copy and distribute your modified - * version of the Library in object code or as an executable provided - * that you also do one of the following: - * - * Accompany the modified version of the Library with the complete - * corresponding machine-readable source code for the modified version - * of the Library; or, - * - * Accompany the modified version of the Library with a written offer - * for a complete machine-readable copy of the corresponding source - * code of the modified version of the Library. - * - * - * THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY. - */ - -#ifndef MARS_DMA_H -#define MARS_DMA_H - -/** - * \file - * \ingroup group_mars_core - * \brief <b>[MPU]</b> MARS DMA API - */ - -#include <stdint.h> - -/** dma tag reserved for MARS */ -#define MARS_DMA_TAG 31 -/** dma tag 0~31 */ -#define MARS_DMA_TAG_MAX 31 -/** dma single tranfer size max 16KB */ -#define MARS_DMA_SIZE_MAX 16384 - -#if defined(__cplusplus) -extern "C" { -#endif - -/** - * \ingroup group_mars_core - * \brief [MPU] Waits for a dma transfer to complete. - * - * This function will wait until all dma transfer operations currently - * initialized with the specified tag completes. - * - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -void mars_dma_wait(uint32_t tag); - -/** - * \ingroup group_mars_core - * \brief [MPU] Syncs all dma requests with specified tag. - * - * This function will wait until all dma requests with the specified tag are - * processed before continuing past the synchronization point. - * - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -void mars_dma_sync(uint32_t tag); - -/** - * \ingroup group_mars_core - * \brief [MPU] Starts dma transfer from host storage to MPU storage. - * - * This function will start a dma transfer to copy the specified number of - * bytes from host storage to MPU storage. - * - * \param[in] ls - destination MPU storage address [16 byte aligned] - * \param[in] ea - source host storage address [16 byte aligned] - * \param[in] size - size of bytes to transfer - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -void mars_dma_get(void *ls, uint64_t ea, uint32_t size, uint32_t tag); - -/** - * \ingroup group_mars_core - * \brief [MPU] Starts dma get operation and waits for completion. - * - * \param[in] ls - destination MPU storage address [16 byte aligned] - * \param[in] ea - source host storage address [16 byte aligned] - * \param[in] size - size of bytes to transfer - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -static inline void mars_dma_get_and_wait(void *ls, uint64_t ea, - uint32_t size, uint32_t tag) -{ - mars_dma_get(ls, ea, size, tag); - mars_dma_wait(tag); -} - -/** - * \ingroup group_mars_core - * \brief [MPU] Starts dma transfer from MPU storage to host storage. - * - * This function will start a dma transfer to copy the specified number of - * bytes from MPU storage to host storage. - * - * \param[in] ls - source MPU storage address [16 byte aligned] - * \param[in] ea - destination host storage address [16 byte aligned] - * \param[in] size - size of bytes to transfer - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -void mars_dma_put(const void *ls, uint64_t ea, uint32_t size, uint32_t tag); - -/** - * \ingroup group_mars_core - * \brief [MPU] Starts dma put operation and waits for completion. - * - * \param[in] ls - source MPU storage address [16 byte aligned] - * \param[in] ea - destination host storage address [16 byte aligned] - * \param[in] size - size of bytes to transfer - * \param[in] tag - tag identifier of dma transfer [between 0 and 31] - * \return - * none - */ -static inline void mars_dma_put_and_wait(const void *ls, uint64_t ea, - uint32_t size, uint32_t tag) -{ - mars_dma_put((void *)ls, ea, size, tag); - mars_dma_wait(tag); -} - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/base/src/mpu/kernel/Makefile.am b/base/src/mpu/kernel/Makefile.am index 0620394..0376edc 100644 --- a/base/src/mpu/kernel/Makefile.am +++ b/base/src/mpu/kernel/Makefile.am @@ -64,8 +64,7 @@ AM_CPPFLAGS = \ $(extra_cppflags) \ -I$(srcdir)/../../../include/common \ -I$(srcdir)/../../../include/mpu \ - -I$(srcdir)/../../../src/common \ - -I$(srcdir)/../../../src/mpu/lib + -I$(srcdir)/../../../src/common AM_CCASFLAGS = \ $(extra_cppflags) @@ -100,6 +99,4 @@ mars_kernel_SOURCES = \ kernel.c \ mutex.c -mars_kernel_LDADD = $(builddir)/../lib/libmars_base.la - CLEANFILES = *.map diff --git a/base/src/mpu/lib/Makefile.am b/base/src/mpu/lib/Makefile.am index 47e5556..ecfc7ba 100644 --- a/base/src/mpu/lib/Makefile.am +++ b/base/src/mpu/lib/Makefile.am @@ -60,7 +60,6 @@ pkginclude_HEADERS = \ $(srcdir)/../../../include/common/mars/error.h \ $(srcdir)/../../../include/common/mars/mutex_types.h \ $(srcdir)/../../../include/common/mars/workload_types.h \ - $(srcdir)/../../../include/mpu/mars/dma.h \ $(srcdir)/../../../include/mpu/mars/mars.h \ $(srcdir)/../../../include/mpu/mars/module.h @@ -94,5 +93,4 @@ lib_LTLIBRARIES = libmars_base.la libmars_base_la_SOURCES = \ $(srcdir)/../../../src/common/*.h \ - dma.c \ module.c diff --git a/base/src/mpu/lib/dma.c b/base/src/mpu/lib/dma.c deleted file mode 100644 index a33ad64..0000000 --- a/base/src/mpu/lib/dma.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2008 Sony Corporation of America - * - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this Library and associated documentation files (the - * "Library"), to deal in the Library without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Library, and to - * permit persons to whom the Library is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Library. - * - * If you modify the Library, you may copy and distribute your modified - * version of the Library in object code or as an executable provided - * that you also do one of the following: - * - * Accompany the modified version of the Library with the complete - * corresponding machine-readable source code for the modified version - * of the Library; or, - * - * Accompany the modified version of the Library with a written offer - * for a complete machine-readable copy of the corresponding source - * code of the modified version of the Library. - * - * - * THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY. - */ - -#include <assert.h> -#include <spu_mfcio.h> - -#include "mars/dma.h" - -/** dma 16 byte alignment mask */ -#define MARS_DMA_ALIGN_MASK 0xf -/** dma 16 byte size mask */ -#define MARS_DMA_SIZE_MASK 0xf - -void mars_dma_wait(uint32_t tag) -{ - assert(tag <= MARS_DMA_TAG_MAX); - - mfc_write_tag_mask(1 << tag); - mfc_write_tag_update_all(); - mfc_read_tag_status(); -} - -void mars_dma_sync(uint32_t tag) -{ - assert(tag <= MARS_DMA_TAG_MAX); - - mfc_sync(tag); -} - -static void dma(void *ls, uint64_t ea, uint32_t size, uint32_t tag, int get) -{ - assert((size == 1 || size == 2 || size == 4 || size == 8 || - (size & MARS_DMA_SIZE_MASK) == 0) && - ((uintptr_t)ls & MARS_DMA_ALIGN_MASK) == - ((uintptr_t)ea & MARS_DMA_ALIGN_MASK) && - ((uintptr_t)ea & (size - 1) & MARS_DMA_ALIGN_MASK) == 0); - assert(tag <= MARS_DMA_TAG_MAX); - - while (size) { - unsigned int block_size; - - block_size = (size < MARS_DMA_SIZE_MAX) ? - size : MARS_DMA_SIZE_MAX; - - if (get) - mfc_get((volatile void *)ls, ea, block_size, tag, 0, 0); - else - mfc_put((volatile void *)ls, ea, block_size, tag, 0, 0); - - ls += block_size; - ea += block_size; - size -= block_size; - } -} - -void mars_dma_get(void *ls, uint64_t ea, uint32_t size, uint32_t tag) -{ - dma(ls, ea, size, tag, 1); -} - -void mars_dma_put(const void *ls, uint64_t ea, uint32_t size, uint32_t tag) -{ - dma((void *)ls, ea, size, tag, 0); -} |