From 552b9b9a43ba7a908b822ec1dbad009ad64b4d71 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 15 Sep 2019 10:18:03 +0200 Subject: [PATCH] dma: only expose API on fxcg50 Currently there seems to be no DMA at all on fx9860g. Further investigation would be required, because this would be the first major difference between the SH7305's found in fx9860g and fxcg50 models. An automated peripheral register discovery strategy might help, but identifying discovered registers would be non trivial. Also use the pruning ability of the Makefile to avoid troublesome ifdef's in the code. --- include/gint/dma.h | 7 ++++--- include/gint/hardware.h | 2 +- make/Makefile | 4 ++-- src/r61524/r61524.c | 4 ---- src/t6k11/t6k11.c | 4 ---- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/gint/dma.h b/include/gint/dma.h index 6e4f978..be8528b 100644 --- a/include/gint/dma.h +++ b/include/gint/dma.h @@ -1,13 +1,12 @@ //--- // gint:dma - Direct Memory Access for efficient data transfer -// -// Currently this module is used only to transfer data to the display on -// fxcg50, but fast memcpy() is apparently possible as well. //--- #ifndef GINT_DMA #define GINT_DMA +#ifdef FXCG50 + #include /* dma_size_t - Transfer block size */ @@ -94,4 +93,6 @@ void dma_transfer_noint(int channel, dma_size_t size, uint blocks, @size Sie of destination area (32-aligned) */ void *dma_memset(void *dst, uint32_t pattern, size_t size); +#endif /* FXCG50 */ + #endif /* GINT_DMA */ diff --git a/include/gint/hardware.h b/include/gint/hardware.h index 18d1d1f..0c8b4b6 100644 --- a/include/gint/hardware.h +++ b/include/gint/hardware.h @@ -124,7 +124,7 @@ void hw_detect(void); ** Direct Memory Access Controller */ -/* Nothing other than the HW_LOADED bit yet */ +/* Nothing other than the HW_LOADED bit yet. Only valid on fxcg50 */ /* ** Timer Unit diff --git a/make/Makefile b/make/Makefile index 5edb015..124c0a0 100755 --- a/make/Makefile +++ b/make/Makefile @@ -46,8 +46,8 @@ src2obj = $(1:../src/%=src/%).o src2dep = $(1:../src/%=src/%).d # Source files -prune-fx := -name render-cg -prune -prune-cg := -name render-fx -prune -o -name gray -prune +prune-fx := -name render-cg -prune -o -name dma -prune -o -name r61524 -prune +prune-cg := -name render-fx -prune -o -name gray -prune -o -name t6k11 -prune src := $(shell find ../src \ $(prune-$(CONFIG.TARGET)) \ -o -name '*.[csS]' -print) diff --git a/src/r61524/r61524.c b/src/r61524/r61524.c index f2cb576..09dcbda 100644 --- a/src/r61524/r61524.c +++ b/src/r61524/r61524.c @@ -7,8 +7,6 @@ #include #include -#ifdef FXCG50 - #define DMA SH7305_DMA #define POWER SH7305_POWER @@ -309,5 +307,3 @@ gint_driver_t drv_r61524 = { }; GINT_DECLARE_DRIVER(5, drv_r61524); - -#endif /* FXCG50 */ diff --git a/src/t6k11/t6k11.c b/src/t6k11/t6k11.c index 1af6eb6..04b81f1 100644 --- a/src/t6k11/t6k11.c +++ b/src/t6k11/t6k11.c @@ -11,8 +11,6 @@ #include -#ifdef FX9860G - //--- // Device specification sheet //--- @@ -261,5 +259,3 @@ gint_driver_t drv_t6k11 = { }; GINT_DECLARE_DRIVER(5, drv_t6k11); - -#endif /* FX9860G */